{"record":{"id":"7b847d04879cf57e","repo":"kubernetes/kops","slug":"found-multiple-instance-groups-matching-q","errorCode":null,"errorMessage":"found multiple instance groups matching %q","messagePattern":"found multiple instance groups matching %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/status.go","lineNumber":225,"sourceCode":"}\n\n// keyedByName creates a map of instance groups keyed by VM Scale Set names.\nfunc keyedByName(instancegroups []*kops.InstanceGroup, clusterName string) (map[string]*kops.InstanceGroup, error) {\n\tm := map[string]*kops.InstanceGroup{}\n\tfor _, ig := range instancegroups {\n\t\tvar name string\n\t\tswitch {\n\t\tcase ig.Spec.Role.HasControlPlane():\n\t\t\tname = ig.Name + \".masters.\" + clusterName\n\t\tcase ig.Spec.Role.HasNode(),\n\t\t\tig.Spec.Role.HasBastion():\n\t\t\tname = ig.Name + \".\" + clusterName\n\t\tdefault:\n\t\t\tklog.Warningf(\"Ignoring InstanceGroup of unknown role %q\", ig.Spec.Role)\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := m[name]; ok {\n\t\t\treturn nil, fmt.Errorf(\"found multiple instance groups matching %q\", name)\n\t\t}\n\t\tm[name] = ig\n\t}\n\n\treturn m, nil\n}\n","sourceCodeStart":207,"sourceCodeEnd":232,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/status.go#L207-L232","documentation":"keyedByName guard: after deriving the expected VM Scale Set name (%q) from an instance group's role, that name was already present in the map — two instance groups resolve to the same scale set name (duplicate names or ambiguous role suffixing).","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/azure/status.go:225 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run 'kops get ig' and rename or delete the duplicate instance group","Verify each instance group name is unique within the cluster"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}