{"record":{"id":"beb43107fdd29aff","repo":"kubernetes/kops","slug":"controlplaneref-kind-was-q-for-v-expected-kopsc","errorCode":null,"errorMessage":"controlPlaneRef.kind was %q for %v, expected KopsControlPlane","messagePattern":"controlPlaneRef\\.kind was %q for (.+?), expected KopsControlPlane","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/controllers/clusterapi/utils.go","lineNumber":124,"sourceCode":"\n\treturn cluster, nil\n}\n\nfunc getKopsControlPlaneFromCAPICluster(ctx context.Context, kube client.Client, capiCluster *unstructured.Unstructured) (*v1beta1.KopsControlPlane, error) {\n\tcapiClusterKey := types.NamespacedName{\n\t\tNamespace: capiCluster.GetNamespace(),\n\t\tName:      capiCluster.GetName(),\n\t}\n\tname, _, _ := unstructured.NestedString(capiCluster.Object, \"spec\", \"controlPlaneRef\", \"name\")\n\tif name == \"\" {\n\t\treturn nil, fmt.Errorf(\"controlPlaneRef.name not set for %v\", capiClusterKey)\n\t}\n\tkind, _, _ := unstructured.NestedString(capiCluster.Object, \"spec\", \"controlPlaneRef\", \"kind\")\n\tif kind == \"\" {\n\t\treturn nil, fmt.Errorf(\"controlPlaneRef.kind not set for %v\", capiClusterKey)\n\t}\n\tif kind != \"KopsControlPlane\" {\n\t\treturn nil, fmt.Errorf(\"controlPlaneRef.kind was %q for %v, expected KopsControlPlane\", kind, capiClusterKey)\n\t}\n\n\tkey := types.NamespacedName{\n\t\tNamespace: capiCluster.GetNamespace(),\n\t\tName:      name,\n\t}\n\n\t// TODO: Add ip addresses to status\n\n\tkopsControlPlane := &v1beta1.KopsControlPlane{}\n\tif err := kube.Get(ctx, key, kopsControlPlane); err != nil {\n\t\treturn nil, fmt.Errorf(\"error fetching KopsControlPlane %v: %w\", key, err)\n\t}\n\n\treturn kopsControlPlane, nil\n}\n","sourceCodeStart":106,"sourceCodeEnd":141,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/controllers/clusterapi/utils.go#L106-L141","documentation":"The CAPI Cluster's spec.controlPlaneRef.kind is populated but is not 'KopsControlPlane'; the kOps controller can only reconcile control planes of that kind, so the cluster is being driven by an incompatible provider.","triggerScenarios":"Thrown at pkg/controllers/clusterapi/utils.go:124 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point controlPlaneRef at the KopsControlPlane resource for this cluster","Remove the foreign controlPlaneRef if this cluster is not meant to be kOps-managed"],"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"}