open-cluster-management-io / api

Core APIs for open cluster management
https://open-cluster-management.io
Apache License 2.0
251 stars 77 forks source link

The v1beta1 klusterlet CRD is invalid #192

Open zhujian7 opened 1 year ago

zhujian7 commented 1 year ago

The klusterlet CRD generated for kubernetes cluster which's version is <=1.16 is invalid

If we apply this CRD to a 1.16.3 kubernetes cluster, will get:

# kubectl apply -f operator/v1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml
The CustomResourceDefinition "klusterlets.operator.open-cluster-management.io" is invalid:
* spec.validation.openAPIV3Schema.properties[spec].properties[registrationConfiguration].properties[featureGates].items.properties[mode].default: Forbidden: must not be set
* spec.validation.openAPIV3Schema.properties[spec].properties[workConfiguration].properties[featureGates].items.properties[mode].default: Forbidden: must not be set

Another validation result from GitHub action

zhujian7 commented 1 year ago

I am considering if we can remove the default value of the feature gate like this, but it will be a dangerous change. If you are using the featureGates configuration and no mode is configured, you will be hit. E.g:

spec:
   registrationConfiguration:
     featureGates:
     - feature: DefaultClusterSet
        mode: Enable
     - feature: V1beta1CSRAPICompatibility   # no mode configured

So we are very cautious about this change and want to know if anyone uses it like 👆🏻 this.

This will not impact the upgrading, all existing clustermanager/klusterlet on the cluster must already have the mode value Disable. But for the new creating clustermanager/klusterlet, it is required to specify the mode value explicitly.

zhujian7 commented 1 year ago

cc @ivan-cai Any concerns, suggestions?