{"record":{"id":"d37f1a5e074c65f9","repo":"kubernetes/kops","slug":"error-registering-kops-control-plane-cluster-api","errorCode":null,"errorMessage":"error registering kops control-plane cluster API: %v","messagePattern":"error registering kops control-plane cluster API: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cmd/kops-controller/main.go","lineNumber":306,"sourceCode":"\nfunc buildScheme(opt *config.Options) (*runtime.Scheme, error) {\n\tscheme := runtime.NewScheme()\n\tif err := corev1.AddToScheme(scheme); err != nil {\n\t\treturn nil, fmt.Errorf(\"error registering corev1: %v\", err)\n\t}\n\tif err := v1alpha2.AddToScheme(scheme); err != nil {\n\t\treturn nil, fmt.Errorf(\"error registering kops/v1alpha2 API: %v\", err)\n\t}\n\t// Needed so that the leader-election system can post events\n\tif err := coordinationv1.AddToScheme(scheme); err != nil {\n\t\treturn nil, fmt.Errorf(\"error registering coordinationv1: %v\", err)\n\t}\n\tif opt.CAPI.IsEnabled() {\n\t\tif err := bootstrapapi.AddToScheme(scheme); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error registering kops bootstrap cluster API: %v\", err)\n\t\t}\n\t\tif err := controlplaneapi.AddToScheme(scheme); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error registering kops control-plane cluster API: %v\", err)\n\t\t}\n\t}\n\n\treturn scheme, nil\n}\n\nfunc addNodeController(ctx context.Context, mgr manager.Manager, opt *config.Options) error {\n\tvar capiManager *capimanager.Manager\n\tif opt.CAPI.IsEnabled() {\n\t\tcapiManager = capimanager.NewManager(mgr.GetClient())\n\t}\n\n\tvar identifier nodeidentity.Identifier\n\tvar err error\n\tswitch opt.Cloud {\n\tcase \"aws\":\n\t\tidentifier, err = nodeidentityaws.New(ctx, opt.CacheNodeidentityInfo)\n\t\tif err != nil {","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops-controller/main.go#L288-L324","documentation":"buildScheme conditionally registers the CAPI control-plane cluster API types when Cluster API is enabled; this wraps that AddToScheme call failing, an internal registration/build error rather than a runtime cluster problem.","triggerScenarios":"opt.CAPI.IsEnabled() is true and controlplaneapi.AddToScheme(scheme) errors — duplicate registration or module version skew in the control-plane provider packages.","commonSituations":"CAPI control-plane provider version incompatible with the vendored sigs.k8s.io/cluster-api core version.","solutions":["Align cluster-api control-plane provider and core versions via `make gomod`","Check go.mod for duplicate provider module versions","Disable --cluster-api if CAPI support is not required"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if opt.CAPI.IsEnabled() {\n\tif err := controlplaneapi.AddToScheme(scheme); err != nil {\n\t\treturn nil, err\n\t}\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Align control-plane provider module with cluster-api core version","Check go.mod for duplicate provider versions after upgrades","Cover CAPI-enabled scheme building in CI tests"],"tags":["cluster-api","scheme","startup","dependencies"],"backgroundTag":"scheme-registration-failed","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"}