Просмотр исходного кода

Update the NodeMap with default cost data on failure (#1905)

Signed-off-by: Matt Bolt <mbolt35@gmail.com>
Matt Bolt 3 лет назад
Родитель
Сommit
23e33788f6
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      pkg/costmodel/allocation_helpers.go

+ 4 - 1
pkg/costmodel/allocation_helpers.go

@@ -1642,7 +1642,10 @@ func (cm *CostModel) getNodePricing(nodeMap map[nodeKey]*nodePricing, nodeKey no
 		if nodeKey.Node != "" {
 			log.DedupedWarningf(5, "CostModel: failed to find node for %s", nodeKey)
 		}
-		return cm.getCustomNodePricing(false, "")
+		// since the node pricing data is not found, and this won't change for the duration of the allocation
+		// build process, we can update the node map with the defaults to prevent future failed lookups
+		nodeMap[nodeKey] = cm.getCustomNodePricing(false, "")
+		return nodeMap[nodeKey]
 	}
 
 	// If custom pricing is enabled and can be retrieved, override detected