{"record":{"id":"bab79635fa8cdae8","repo":"kubernetes/kops","slug":"error-registering-kops-bootstrap-cluster-api-v","errorCode":null,"errorMessage":"error registering kops bootstrap cluster API: %v","messagePattern":"error registering kops bootstrap cluster API: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cmd/kops-controller/main.go","lineNumber":303,"sourceCode":"\t\tos.Exit(1)\n\t}\n}\n\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 {","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops-controller/main.go#L285-L321","documentation":"buildScheme conditionally registers the CAPI bootstrap cluster API types when Cluster API is enabled; this wraps the bootstrapapi AddToScheme call failing, an internal registration/build error rather than a runtime cluster problem.","triggerScenarios":"opt.CAPI.IsEnabled() is true and bootstrapapi.AddToScheme(scheme) errors — duplicate type registration or version skew between the CAPI bootstrap provider module and other k8s deps.","commonSituations":"CAPI enabled with mismatched sigs.k8s.io/cluster-api / bootstrap provider versions in the module graph.","solutions":["Align sigs.k8s.io/cluster-api and k8s.io/* versions via `make gomod`","Verify only one version of the bootstrap API package is vendored","If CAPI is not needed, disable the --cluster-api flag"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if opt.CAPI.IsEnabled() {\n\tif err := bootstrapapi.AddToScheme(scheme); err != nil {\n\t\treturn nil, err\n\t}\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Align cluster-api bootstrap provider version with core cluster-api","Verify CAPI flag intentionally enabled before shipping config","Run a scheme-build unit test with CAPI enabled"],"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"}