{"record":{"id":"4a4ec46c0c097f38","repo":"kubernetes/kops","slug":"found-multiple-instance-groups-matching-group-q","errorCode":null,"errorMessage":"found multiple instance groups matching group: %q","messagePattern":"found multiple instance groups matching group: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/spotinst/resources.go","lineNumber":405,"sourceCode":"\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc findInstanceGroupFromResource(cluster *kops.Cluster, instanceGroups []*kops.InstanceGroup,\n\tresource *resources.Resource) (*kops.InstanceGroup, error,\n) {\n\tvar instanceGroup *kops.InstanceGroup\n\tfor _, ig := range instanceGroups {\n\t\tname := getGroupNameByRole(cluster, ig)\n\t\tif name == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tif name == resource.Name {\n\t\t\tif instanceGroup != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"found multiple instance groups matching group: %q\", name)\n\t\t\t}\n\n\t\t\tklog.V(2).Infof(\"Found group with corresponding instance group: %q\", name)\n\t\t\tinstanceGroup = ig\n\t\t}\n\t}\n\n\treturn instanceGroup, nil\n}\n\nfunc getGroupNameByRole(cluster *kops.Cluster, ig *kops.InstanceGroup) string {\n\tvar groupName string\n\n\tswitch {\n\tcase ig.Spec.Role.HasControlPlane():\n\t\tgroupName = ig.ObjectMeta.Name + \".masters.\" + cluster.ObjectMeta.Name\n\tcase ig.Spec.Role.HasNode():\n\t\tgroupName = ig.ObjectMeta.Name + \".\" + cluster.ObjectMeta.Name","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/spotinst/resources.go#L387-L423","documentation":"findInstanceGroupFromResource maps a Spotinst Elastigroup/Ocean resource back to a kOps InstanceGroup via a role-derived group name; two InstanceGroups produced the same group name, so the resource-to-IG mapping is ambiguous and kOps refuses to guess.","triggerScenarios":"Thrown at pkg/resources/spotinst/resources.go:405 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or rename the duplicate InstanceGroups so each role maps to a unique group name","Check the cluster's IG names for collisions that normalize to the same Spotinst group name"],"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-12T07:17:12.445Z"}