{"record":{"id":"e71c8346f4f29a11","repo":"kubernetes/kops","slug":"failed-to-find-instance-group-of-resource-q-v","errorCode":null,"errorMessage":"failed to find instance group of resource %q: %v","messagePattern":"failed to find instance group of resource %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/spotinst/resources.go","lineNumber":250,"sourceCode":"\t\t\t\tklog.V(2).Infof(\"Found group with no corresponding instance group: %q\", resource.Name)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tcloudInstanceGroups[resource.Name] = ig\n\t}\n\n\treturn cloudInstanceGroups, nil\n}\n\nfunc buildCloudInstanceGroupFromResource(cloud Cloud, cluster *kops.Cluster,\n\tinstanceGroups []*kops.InstanceGroup, resource *resources.Resource,\n\tnodeMap map[string]*v1.Node) (*cloudinstances.CloudInstanceGroup, error,\n) {\n\t// Find corresponding instance group.\n\tig, err := findInstanceGroupFromResource(cluster, instanceGroups, resource)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to find instance group of resource %q: %v\", resource.Name, err)\n\t}\n\tif ig == nil {\n\t\treturn nil, nil\n\t}\n\n\tswitch ResourceType(resource.Type) {\n\tcase ResourceTypeInstanceGroup:\n\t\t{\n\t\t\tif group, ok := resource.Obj.(InstanceGroup); ok {\n\t\t\t\treturn buildCloudInstanceGroupFromInstanceGroup(cloud, ig, group, nodeMap)\n\t\t\t}\n\t\t}\n\n\tcase ResourceTypeLaunchSpec:\n\t\t{\n\t\t\tif spec, ok := resource.Obj.(LaunchSpec); ok {\n\t\t\t\treturn buildCloudInstanceGroupFromLaunchSpec(cloud, ig, spec, nodeMap)\n\t\t\t}","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/spotinst/resources.go#L232-L268","documentation":"Fires in buildCloudInstanceGroupFromResource when findInstanceGroupFromResource cannot match the spotinst cloud resource (instance group or launch spec) to any kops InstanceGroup by name — the cluster manifest lacks an instance group corresponding to the discovered cloud resource.","triggerScenarios":"Thrown at pkg/resources/spotinst/resources.go:250 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Align the spotinst group/launch spec name with a kops InstanceGroup name in the cluster spec","Remove the orphaned spotinst resource from the ElastiGroup config","Re-run after updating the cluster manifest so names match"],"exampleFix":null,"handlingStrategy":"fallback","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"}