You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.FromContext(ctx).Error(serrors.Wrap(fmt.Errorf("nodeclaim is missing required labels"), "nodeclaim", klog.KObj(&nc), "missingLabels", missingLabels), "failed to update nodeclaim from cost tracking")
399
+
// For static NodeClaims, missing instance-specific labels during creation is expected
400
+
// as they are populated by the cloud provider after creation. Log at debug level
401
+
// instead of error to reduce noise in tests and CI.
402
+
ifisStaticNodeClaim(&nc) {
403
+
log.FromContext(ctx).V(1).Info("static nodeclaim missing labels during initialization, will retry when labels are populated", "nodeclaim", klog.KObj(&nc), "missingLabels", missingLabels)
404
+
} else {
405
+
log.FromContext(ctx).Error(serrors.Wrap(fmt.Errorf("nodeclaim is missing required labels"), "nodeclaim", klog.KObj(&nc), "missingLabels", missingLabels), "failed to update nodeclaim from cost tracking")
406
+
}
400
407
returntrue
401
408
}
402
409
403
410
returnfalse
404
411
}
412
+
413
+
// isStaticNodeClaim determines if a NodeClaim belongs to a static NodePool
414
+
// by checking for the presence of static-specific annotations or owner references
415
+
funcisStaticNodeClaim(nc*v1.NodeClaim) bool {
416
+
// Static NodeClaims are created from NodePools with replicas set
417
+
// We can identify them by checking if they have the NodePool owner reference
418
+
// and the NodePool has static characteristics
419
+
for_, ownerRef:=rangenc.GetOwnerReferences() {
420
+
ifownerRef.Kind=="NodePool" {
421
+
// This is likely a static NodeClaim if it's owned by a NodePool
422
+
// Additional heuristic: static NodeClaims often lack instance-specific labels initially
0 commit comments