{"record":{"id":"071c53f38fd98f7d","repo":"kubernetes/kops","slug":"instancegroup-q-not-found-071c53","errorCode":null,"errorMessage":"InstanceGroup %q not found","messagePattern":"InstanceGroup %q not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/rolling-update_cluster.go","lineNumber":313,"sourceCode":"\tif countByRole[kopsapi.InstanceGroupRoleAPIServer]+countByRole[kopsapi.InstanceGroupRoleControlPlane] <= 1 {\n\t\toptions.DeregisterControlPlaneNodes = false\n\t}\n\n\twarnUnmatched := true\n\n\tif len(options.InstanceGroups) != 0 {\n\t\tvar filtered []*kopsapi.InstanceGroup\n\n\t\tfor _, instanceGroupName := range options.InstanceGroups {\n\t\t\tvar found *kopsapi.InstanceGroup\n\t\t\tfor _, ig := range instanceGroups {\n\t\t\t\tif ig.ObjectMeta.Name == instanceGroupName {\n\t\t\t\t\tfound = ig\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif found == nil {\n\t\t\t\treturn fmt.Errorf(\"InstanceGroup %q not found\", instanceGroupName)\n\t\t\t}\n\n\t\t\tfiltered = append(filtered, found)\n\t\t}\n\n\t\tinstanceGroups = filtered\n\n\t\t// Don't warn if we find more ASGs than IGs\n\t\twarnUnmatched = false\n\t}\n\n\tif len(options.InstanceGroupRoles) != 0 {\n\t\tvar filtered []*kopsapi.InstanceGroup\n\n\t\tfor _, role := range options.InstanceGroupRoles {\n\t\t\ts, f := kopsapi.ParseInstanceGroupRole(role, true)\n\t\t\tif !f {\n\t\t\t\treturn fmt.Errorf(\"invalid instance group role %q\", role)","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/rolling-update_cluster.go#L295-L331","documentation":"When --instance-group (or options.InstanceGroups) is supplied, RunRollingUpdateCluster filters the cluster's instance groups to the named ones. If a requested name does not match any InstanceGroup in the cluster, it returns \"InstanceGroup %q not found\". This is a user-input validation error against the cluster's actual IG list.","triggerScenarios":"options.InstanceGroupName (e.g. from --instance-group) contains a name for which no kopsapi.InstanceGroup with matching ObjectMeta.Name exists in the instance groups fetched from the cluster state store.","commonSituations":"Typo in the IG name (e.g. nodes-eu-west vs nodes); IG was renamed or deleted; running against the wrong cluster that lacks that IG; referencing a master IG by an old name.","solutions":["List actual instance groups: kops get instancegroups <cluster> (or kops get ig <cluster>) and correct the --instance-group value","Check you are targeting the right cluster name/state store (KOPS_STATE_STORE)","Recreate the missing IG with kops create ig if it was deleted intentionally","Remove the --instance-group flag to roll all groups"],"exampleFix":"// before\nkops rolling-update cluster mycluster.k8s.local --instance-group nodez\n// error: InstanceGroup \"nodez\" not found\n// after (name corrected per `kops get ig`)\nkops rolling-update cluster mycluster.k8s.local --instance-group nodes","handlingStrategy":"validation","validationCode":"// list instance groups and check membership before invoking\nigs, err := clientset.InstanceGroupsFor(cluster).List(ctx, metav1.ListOptions{})\nif err != nil { return err }\nwanted := \"nodes\"\nfound := false\nfor _, ig := range igs.Items {\n    if ig.ObjectMeta.Name == wanted { found = true; break }\n}\nif !found { return fmt.Errorf(\"instance group %q does not exist; run `kops get ig`\", wanted) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `kops get instancegroups <cluster>` to copy exact IG names","Watch for control-plane/master renames between kops versions","Ensure KOPS_STATE_STORE points at the same state store used to create the IGs","Use shell completion for --instance-group values"],"tags":["instancegroup","validation","cli-flags"],"backgroundTag":"resource-not-found","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"}