{"record":{"id":"ddd61a360a6ddfcf","repo":"kubernetes/kops","slug":"cluster-q-was-not-found","errorCode":null,"errorMessage":"cluster %q was not found","messagePattern":"cluster %q was not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/get_instancegroups.go","lineNumber":103,"sourceCode":"\t\t},\n\t}\n\n\treturn cmd\n}\n\nfunc RunGetInstanceGroups(ctx context.Context, f commandutils.Factory, out io.Writer, options *GetInstanceGroupsOptions) error {\n\tclientset, err := f.KopsClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcluster, err := clientset.GetCluster(ctx, options.ClusterName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error fetching cluster %q: %v\", options.ClusterName, err)\n\t}\n\n\tif cluster == nil {\n\t\treturn fmt.Errorf(\"cluster %q was not found\", options.ClusterName)\n\t}\n\n\tlist, err := clientset.InstanceGroupsFor(cluster).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinstancegroups, err := filterInstanceGroupsByName(options.InstanceGroupNames, list.Items)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsingleObject := false\n\n\tif len(instancegroups) == 0 {\n\t\treturn fmt.Errorf(\"no InstanceGroup objects found\")\n\t} else if len(instancegroups) == 1 {\n\t\tsingleObject = true","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/get_instancegroups.go#L85-L121","documentation":"Guard in RunGetInstanceGroups: GetCluster returned success but a nil cluster, meaning no cluster exists under options.ClusterName. It fires when `kops get instancegroups` is run against a cluster name (from --name or the kubecfg context) that has not been created or is not readable from state storage.","triggerScenarios":"Thrown at cmd/kops/get_instancegroups.go:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the cluster name spelling and the --name flag","List clusters with kops get clusters to see what exists","Verify the configured state store is the right one"],"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"}