{"record":{"id":"c5845bc459c8e747","repo":"kubernetes/kops","slug":"building-node-labels-for-instance-group-q-w","errorCode":null,"errorMessage":"building node labels for instance group %q: %w","messagePattern":"building node labels for instance group %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/template_functions.go","lineNumber":1203,"sourceCode":"\t\t\tcontinue\n\t\t}\n\t\tif ig.Spec.Autoscale != nil && !fi.ValueOf(ig.Spec.Autoscale) {\n\t\t\tcontinue\n\t\t}\n\n\t\ttask, err := tf.Task(\"ServerGroup\", ig.Name)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"finding server group task for instance group %q: %w\", ig.Name, err)\n\t\t}\n\n\t\tserverGroup, ok := task.(*hetznertasks.ServerGroup)\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"server group task for instance group %q has unexpected type %T\", ig.Name, task)\n\t\t}\n\n\t\tnodeLabels, err := nodelabels.BuildNodeLabels(tf.Cluster, ig)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"building node labels for instance group %q: %w\", ig.Name, err)\n\t\t}\n\n\t\tuserDataBytes, err := fi.ResourceAsBytes(serverGroup.UserData)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"reading user-data for instance group %q: %w\", ig.Name, err)\n\t\t}\n\n\t\tvar taints []corev1.Taint\n\t\tfor _, taintSpec := range ig.Spec.Taints {\n\t\t\tparsed, err := util.ParseTaint(taintSpec)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"parsing taints for instance group %q: %w\", ig.Name, err)\n\t\t\t}\n\t\t\ttaints = append(taints, corev1.Taint{\n\t\t\t\tKey:    parsed[\"key\"],\n\t\t\t\tValue:  parsed[\"value\"],\n\t\t\t\tEffect: corev1.TaintEffect(parsed[\"effect\"]),\n\t\t\t})","sourceCodeStart":1185,"sourceCodeEnd":1221,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/template_functions.go#L1185-L1221","documentation":"For each Hetzner node group, HCloudClusterConfig calls nodelabels.BuildNodeLabels(tf.Cluster, ig) to compute kubernetes node labels for the ServerGroup. If label building fails, the error wraps it with the instance group name.","triggerScenarios":"BuildNodeLabels returns an error for the given cluster/instance group — e.g. invalid instance group metadata/spec fields that label construction depends on, or unsupported cloud provider in the cluster spec for label building.","commonSituations":"Invalid characters/values in instance group spec affecting labels; cluster spec fields (roles, cloudProvider) inconsistent with what nodelabels expects; forked/older nodelabels package missing support for a new field.","solutions":["Inspect the wrapped inner error for the exact label-building failure.","Validate the instance group spec (names, roles, zones) for invalid values.","Upgrade kOps so cluster and nodelabels code are from the same version."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// Go: validate cluster/ig fields BuildNodeLabels depends on\nif cluster == nil || ig == nil || ig.ObjectMeta.Name == \"\" {\n    return fmt.Errorf(\"cluster and named instance group required before building node labels\")\n}","typeGuard":null,"tryCatchPattern":"// Go\nnodeLabels, err := nodelabels.BuildNodeLabels(tf.Cluster, ig)\nif err != nil {\n    return \"\", fmt.Errorf(\"building node labels for instance group %q: %w\", ig.Name, err)\n}","preventionTips":["Validate instance group specs before template execution","Keep nodelabels package version aligned with the cluster spec schema","Log the wrapped inner error for diagnosis"],"tags":["hetzner","node-labels","instance-group"],"backgroundTag":"node-label-build-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}