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
.
e.g.
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