func()

in pkg/model/node.go [188:205]


func (n *Node) UpdatePrice(pricing *pricing.Provider) {
	// lookup our n price
	n.Price = math.NaN()
	if n.IsOnDemand() {
		if price, ok := pricing.OnDemandPrice(n.InstanceType()); ok {
			n.Price = price
		}
	} else if n.IsSpot() {
		if price, ok := pricing.SpotPrice(n.InstanceType()); ok {
			n.Price = price
		}
	// Use on-demand prices if no Karpenter label is found
	} else {
		if price, ok := pricing.OnDemandPrice(n.InstanceType()); ok {
			n.Price = price
		}
	}
}