kubernetes / sample-controller

Repository for sample controller. Complements sample-apiserver
Apache License 2.0
3.14k stars 1.08k forks source link

Move CRD from `v1beta1` to `v1` #80

Closed MadhavJivrajani closed 3 years ago

MadhavJivrajani commented 3 years ago

When creating the CR, the API server warns about the deprecation of CustomResourceDefinition in v1beta1 and unavailability from 1.22:

Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition

I'd be happy to take this up unless there's a specific reason to keep it in v1beta1. /assign

nikhita commented 3 years ago

Thanks for taking this up!

MadhavJivrajani commented 3 years ago

Hey @nikhita, quick question: I changed those versions and updated the yaml files accordingly to be compatible with 1.21, I'm now trying to change the group version for the CR from v1alpha1 to v1 (so that the CR is more or less consistent with the docs for CRs and CRDs) and trying to run update-codegen.sh for getting started, but the code for the target generators isn't being generated, I get this output as well:

Generating deepcopy funcs
Generating clientset for samplecontroller:v1 at k8s.io/sample-controller/pkg/generated/clientset
Generating listers for samplecontroller:v1 at k8s.io/sample-controller/pkg/generated/listers
Generating informers for samplecontroller:v1 at k8s.io/sample-controller/pkg/generated/informers

I changed hack/update-codegen.sh to have samplecontroller:v1 instead of samplecontroller:v1alpha1. I'm not sure what I'm missing, any tips?

nikhita commented 3 years ago

@MadhavJivrajani you will need to manually move the types.go, register.go, etc files from the v1alpha1 directory to v1 - https://github.com/kubernetes/sample-controller/tree/master/pkg/apis/samplecontroller/v1alpha1