{"record":{"id":"09325067be2aa945","repo":"kubernetes/kops","slug":"unhandled-kind-q-in-s","errorCode":null,"errorMessage":"unhandled kind %q in %s","messagePattern":"unhandled kind %q in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create.go","lineNumber":210,"sourceCode":"\n\t\t\t\tsshCredentialStore, err := clientset.SSHCredentialStore(cluster)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tsshKeyArr := []byte(v.Spec.PublicKey)\n\t\t\t\terr = sshCredentialStore.AddSSHPublicKey(ctx, sshKeyArr)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(&sb, \"Added ssh credential\\n\")\n\n\t\t\tcase *unstructured.Unstructured:\n\t\t\t\taddons = append(addons, kubemanifest.NewObject(v.Object))\n\n\t\t\tdefault:\n\t\t\t\tklog.V(2).Infof(\"Type of object was %T\", v)\n\t\t\t\treturn fmt.Errorf(\"unhandled kind %q in %s\", gvk, f)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Because not all addons support labels, we can only support one cluster here.\n\t// A single cluster per create is probably a good idea anyway.\n\tif len(addons) != 0 {\n\t\tif len(clusters) > 1 {\n\t\t\treturn fmt.Errorf(\"cannot specify additional objects when multiple clusters are created\")\n\t\t}\n\t\tif len(clusters) == 0 {\n\t\t\treturn fmt.Errorf(\"must specify a cluster when creating additional objects\")\n\t\t}\n\t\tcluster := clusters[0]\n\n\t\taddonsClient := clientset.AddonsFor(cluster)\n\n\t\tif err := addonsClient.Replace(addons); err != nil {","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create.go#L192-L228","documentation":"`kops create -f` only understands Cluster, InstanceGroup, SSHCredential, and unstructured add-on objects. Any other kind decoded from the input file falls into the default branch and aborts the whole command with this error naming the GroupVersionKind and the file.","triggerScenarios":"`kops create -f file.yaml` containing e.g. kind: Keyset, kind: ClusterConfiguration, a Kubernetes core/v1 object, or a typo'd/unknown kind string that decodes to a non-supported type.","commonSituations":"Feeding a full cluster spec bundle (keysets, configs) to plain `kops create` instead of `kops apply`; YAML with typo'd apiVersion causing codec to return an unstructured/unknown type; mixing Kubernetes-native manifests (Deployment etc.) into the kops config file.","solutions":["Remove unsupported kind documents from the -f file and manage them with `kops apply`/`kops replace`","Fix the kind/apiVersion spelling to one of Cluster, InstanceGroup, SSHCredential","Split the file so kops-specific resources go through `kops create -f` and add-ons through `kops replace -f` (unstructured)","Check `kops create -f file --dry-run` output to see which section is offending"],"exampleFix":"# before\nkind: Keyset\nmetadata:\n  name: apiserver-aggregator-ca\n# after (remove from create -f input; apply instead)\n# kops apply -f file.yaml","handlingStrategy":"type-guard","validationCode":"allowed := map[string]bool{\"Cluster\": true, \"InstanceGroup\": true, \"SSHCredential\": true}\nfor _, doc := range docs {\n    if !allowed[doc.Kind] {\n        return fmt.Errorf(\"kind %s not supported by kops create -f\", doc.Kind)\n    }\n}","typeGuard":"func isSupportedKopsObject(o runtime.Object) bool {\n    switch o.(type) {\n    case *kopsapi.Cluster, *kopsapi.InstanceGroup, *kopsapi.SSHCredential, *unstructured.Unstructured:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Keep kops config files free of Kubernetes-native and keyset/config objects","Route add-ons and other objects through `kops replace`/`kops apply`","Pin kops CLI version compatible with the manifest's apiVersion"],"tags":["kops","cli","unsupported-kind","manifest"],"backgroundTag":"unsupported-resource-kind","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"}