Kubernetes client returns “panic: Double registration of different types”

If you run your k8s code and receive “panic: Double registration of different types”

it means that in apis/foo.bar.com/v2, in register.go, you have incorrectly specified the new version when setting up var SchemeGroupVersion.


In apis/foo.bar.com/v1/register.go:

var SchemeGroupVersion = schema.GroupVersion{Group: "foo.bar.com", Version: "v1"}

and in apis/foo.bar.com/v2/register.go:

var SchemeGroupVersion = schema.GroupVersion{Group: "foo.bar.com", Version: "v1"} // should be "v2"

Change the version and re-run your client gen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s