{"record":{"id":"842b740f3cf02b90","repo":"GoogleContainerTools/skaffold","slug":"kind-s-is-not-supported","errorCode":null,"errorMessage":"kind %s is not supported","messagePattern":"kind (.+?) is not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/skaffold/kubernetes/owner.go","lineNumber":69,"sourceCode":"\t}\n\n\tswitch owner.Kind {\n\tcase \"Deployment\":\n\t\treturn client.AppsV1().Deployments(ns).Get(ctx, owner.Name, metav1.GetOptions{})\n\tcase \"ReplicaSet\":\n\t\treturn client.AppsV1().ReplicaSets(ns).Get(ctx, owner.Name, metav1.GetOptions{})\n\tcase \"Job\":\n\t\treturn client.BatchV1().Jobs(ns).Get(ctx, owner.Name, metav1.GetOptions{})\n\tcase \"CronJob\":\n\t\treturn client.BatchV1beta1().CronJobs(ns).Get(ctx, owner.Name, metav1.GetOptions{})\n\tcase \"StatefulSet\":\n\t\treturn client.AppsV1().StatefulSets(ns).Get(ctx, owner.Name, metav1.GetOptions{})\n\tcase \"ReplicationController\":\n\t\treturn client.CoreV1().ReplicationControllers(ns).Get(ctx, owner.Name, metav1.GetOptions{})\n\tcase \"Pod\":\n\t\treturn client.CoreV1().Pods(ns).Get(ctx, owner.Name, metav1.GetOptions{})\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"kind %s is not supported\", owner.Kind)\n\t}\n}\n","sourceCodeStart":51,"sourceCodeEnd":72,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/kubernetes/owner.go#L51-L72","documentation":"ownerMetaObject resolves a Kubernetes resource's owner reference to its owning object by looking it up with the appropriate typed client. Only a fixed set of kinds (Deployment, ReplicaSet, Job, CronJob, StatefulSet, ReplicationController, Pod) is supported; any other owner Kind hits the default branch and returns this error. The caller (TopLevelOwnerKey) logs a warning and returns an empty owner key.","triggerScenarios":"Walking owner references of a resource whose OwnerReference.Kind is outside the supported list — e.g. DaemonSet, CustomResource (CRD), Service, ConfigMap-owned objects, or controller-generated kinds from operators — during TopLevelOwnerKey.","commonSituations":"Port-forwarding or debugging pods owned by a DaemonSet; resources owned by a custom operator/CRD; newer workload kinds (e.g. custom workload controllers) not in the hardcoded switch.","solutions":["Identify the unsupported kind from the error message and add a case for it in ownerMetaObject's switch with the appropriate typed client lookup","As a workaround, note the top-level owner key will be empty (TopLevelOwnerKey returns \"\") and the feature degrades gracefully","If a CRD controller creates the pods, trace ownership manually with kubectl get <kind> <name> -o jsonpath='{.metadata.ownerReferences}'"],"exampleFix":"// before\ncase \"Pod\":\n\treturn client.CoreV1().Pods(ns).Get(ctx, owner.Name, metav1.GetOptions{})\ndefault:\n\treturn nil, fmt.Errorf(\"kind %s is not supported\", owner.Kind)\n// after\ncase \"Pod\":\n\treturn client.CoreV1().Pods(ns).Get(ctx, owner.Name, metav1.GetOptions{})\ncase \"DaemonSet\":\n\treturn client.AppsV1().DaemonSets(ns).Get(ctx, owner.Name, metav1.GetOptions{})\ndefault:\n\treturn nil, fmt.Errorf(\"kind %s is not supported\", owner.Kind)","handlingStrategy":"try-catch","validationCode":"// check the owner kind before relying on TopLevelOwnerKey\nsupported := map[string]bool{\"Deployment\": true, \"ReplicaSet\": true, \"Job\": true, \"CronJob\": true, \"StatefulSet\": true, \"ReplicationController\": true, \"Pod\": true}\nvar ownersKnown = true\nfor _, or := range obj.GetOwnerReferences() {\n\tif !supported[or.Kind] { ownersKnown = false }\n}","typeGuard":null,"tryCatchPattern":"key := TopLevelOwnerKey(ctx, obj, kubeContext, kind)\nif key == \"\" {\n\t// owner resolution failed (possibly unsupported kind); fall back to resource's own Kind-Name\n\tkey = fmt.Sprintf(\"%s-%s\", kind, obj.GetName())\n}","preventionTips":["Prefer port-forwarding Deployments/Jobs/StatefulSets rather than custom CRD-owned workloads","Handle the empty TopLevelOwnerKey return value in dependent code","Keep the kind switch in owner.go updated when new workload kinds are introduced"],"tags":["kubernetes","owner-references","api"],"backgroundTag":"unsupported-resource-kind","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}