{"record":{"id":"112cb1fb21b0640c","repo":"kubernetes/kops","slug":"invalid-instancegroup-name-v","errorCode":null,"errorMessage":"invalid InstanceGroup name: %v","messagePattern":"invalid InstanceGroup name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops-controller/pkg/server/node_config.go","lineNumber":51,"sourceCode":"\nfunc (s *Server) getNodeConfig(ctx context.Context, req *nodeup.BootstrapRequest, identity *bootstrap.VerifyResult) (*nodeup.NodeConfig, error) {\n\tlog := klog.FromContext(ctx)\n\n\tif identity == nil {\n\t\treturn nil, fmt.Errorf(\"node identity is required\")\n\t}\n\n\tlog.Info(\"getting node config\", \"req\", req, \"identity\", identity)\n\n\tinstanceGroupName := identity.InstanceGroupName\n\tif instanceGroupName == \"\" {\n\t\tif identity.CAPIMachine == nil {\n\t\t\treturn nil, fmt.Errorf(\"did not find owner for node %q\", identity.NodeName)\n\t\t}\n\t\t// CAPI path: the InstanceGroup is synthesized from the Machine and\n\t\t// the name never reaches the configBase path, so we don't validate it.\n\t} else if errs := kopsvalidation.ValidateInstanceGroupName(instanceGroupName, field.NewPath(\"instanceGroupName\")); len(errs) > 0 {\n\t\treturn nil, fmt.Errorf(\"invalid InstanceGroup name: %v\", errs.ToAggregate())\n\t}\n\n\tvar nodeConfig *nodeup.NodeConfig\n\n\tconfigBuilder := &commands.ConfigBuilder{\n\t\tClientset:   s.clientset,\n\t\tClusterName: s.opt.ClusterName,\n\t}\n\n\tif identity.CAPIMachine != nil && instanceGroupName == \"\" {\n\t\t// We have a CAPI Machine (but no instance group)\n\t\tinstanceGroup, err := s.buildInstanceGroupFromCAPI(ctx, identity.CAPIMachine)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error building InstanceGroup from CAPI Machine: %w\", err)\n\t\t}\n\t\tlog.Info(\"built InstanceGroup from CAPI Machine\", \"instanceGroup\", instanceGroup)\n\t\tconfigBuilder.InstanceGroup = instanceGroup\n\t} else if s.opt.Cloud == \"metal\" {","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops-controller/pkg/server/node_config.go#L33-L69","documentation":"When the verified identity provides an InstanceGroup name, getNodeConfig validates it with kopsvalidation.ValidateInstanceGroupName before using it in configBase paths. If the name violates kops InstanceGroup naming rules (e.g. invalid DNS-label characters, wrong length), the request is rejected with the aggregated validation errors. CAPI-synthesized names skip this validation intentionally, since they never reach configBase paths.","triggerScenarios":"identity.InstanceGroupName is non-empty but fails ValidateInstanceGroupName — typically a name containing characters other than lowercase alphanumeric and '-', starting/ending with '-', or exceeding DNS label length limits.","commonSituations":"Creating an InstanceGroup with an uppercase or underscore name (older kops versions or manual YAML edits); renaming instance groups in cloud tags so a non-conforming name is propagated to nodes; copying an IG name with a trailing space or domain suffix.","solutions":["Rename the InstanceGroup to a valid DNS label: lowercase letters, numbers, and hyphens only, max 63 chars, no leading/trailing hyphen (e.g. via `kops replace` + `kops update cluster --yes`)","Fix the cloud tag or machine metadata that carries the bad InstanceGroup name so nodes report the corrected name","Check `kops get ig -oyaml` and your cluster spec for manually edited names that fail validation","If the name comes from CAPI, verify the CAPI path is active (identity.CAPIMachine set) so the name is synthesized instead of validated"],"exampleFix":"// before\nkind: InstanceGroup\nmetadata:\n  name: Workers_EU1\n// after\nkind: InstanceGroup\nmetadata:\n  name: workers-eu1","handlingStrategy":"validation","validationCode":"if errs := kopsvalidation.ValidateInstanceGroupName(name, field.NewPath(\"instanceGroupName\")); len(errs) > 0 {\n\treturn errs.ToAggregate()\n}","typeGuard":"func validIGName(name string) bool {\n\treturn len(name) <= 63 && regexp.MustCompile(`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`).MatchString(name)\n}","tryCatchPattern":"if strings.Contains(err.Error(), \"invalid InstanceGroup name\") {\n\t// fix the IG name in the cluster spec and re-run kops update\n}","preventionTips":["Name InstanceGroups as valid DNS labels: lowercase alphanumerics and hyphens only, ≤63 chars","Validate IG YAML with kops before applying","Avoid manual edits that inject uppercase, underscores, or whitespace into IG names"],"tags":["kubernetes","kops","validation","instancegroup"],"backgroundTag":"schema-validation-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"}