kubernetes/kops · critical
error registering coordinationv1: %v
Error message
error registering coordinationv1: %v
What it means
buildScheme registers the coordination.k8s.io/v1 API (needed so leader election can post Lease events); this wraps coordinationv1.AddToScheme failing, an internal registration error unrelated to user configuration.
Source
Thrown at cmd/kops-controller/main.go:299
setupLog.Info("starting manager")
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
setupLog.Error(err, "problem running manager")
os.Exit(1)
}
}
func buildScheme(opt *config.Options) (*runtime.Scheme, error) {
scheme := runtime.NewScheme()
if err := corev1.AddToScheme(scheme); err != nil {
return nil, fmt.Errorf("error registering corev1: %v", err)
}
if err := v1alpha2.AddToScheme(scheme); err != nil {
return nil, fmt.Errorf("error registering kops/v1alpha2 API: %v", err)
}
// Needed so that the leader-election system can post events
if err := coordinationv1.AddToScheme(scheme); err != nil {
return nil, fmt.Errorf("error registering coordinationv1: %v", err)
}
if opt.CAPI.IsEnabled() {
if err := bootstrapapi.AddToScheme(scheme); err != nil {
return nil, fmt.Errorf("error registering kops bootstrap cluster API: %v", err)
}
if err := controlplaneapi.AddToScheme(scheme); err != nil {
return nil, fmt.Errorf("error registering kops control-plane cluster API: %v", err)
}
}
return scheme, nil
}
func addNodeController(ctx context.Context, mgr manager.Manager, opt *config.Options) error {
var capiManager *capimanager.Manager
if opt.CAPI.IsEnabled() {
capiManager = capimanager.NewManager(mgr.GetClient())
}View on GitHub (pinned to 4c8573c808)
Solutions
- Align k8s.io/* module versions with `make gomod` / `go mod tidy`
- Check go.mod for multiple k8s.io/api major versions
- Rebuild after clearing module cache
Defensive patterns
Strategy: validation
Validate before calling
if err := coordinationv1.AddToScheme(scheme); err != nil {
return nil, err
}
Prevention
- Keep k8s.io/api and apimachinery versions aligned
- Rebuild in CI to catch duplicate registration at compile time
When it happens
Trigger: coordinationv1.AddToScheme(scheme) returns an error from incompatible or duplicated k8s.io/api versions in the build.
Common situations: k8s.io/api version skew in go.mod causing duplicate type registration failures across the scheme build.
Related errors
- error registering corev1: %v
- error registering kops/v1alpha2 API: %v
- error registering kops bootstrap cluster API: %v
- error registering kops control-plane cluster API: %v
- building kubernetes scheme: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/88be16d636dfb6b8.
Report an issue: GitHub.