port kcm feature to versioned

This commit is contained in:
Jefftree 2024-09-26 19:48:08 +00:00
parent c9a999df1a
commit de2e232a85
5 changed files with 20 additions and 22 deletions

View File

@ -157,12 +157,6 @@ const (
// Enables kubelet to detect CSI volume condition and send the event of the abnormal volume to the corresponding pod that is using it.
CSIVolumeHealth featuregate.Feature = "CSIVolumeHealth"
// owner: @nckturner
// kep: http://kep.k8s.io/2699
// alpha: v1.27
// Enable webhooks in cloud controller manager
CloudControllerManagerWebhook featuregate.Feature = "CloudControllerManagerWebhook"
// owner: @adrianreber
// kep: https://kep.k8s.io/2008
// alpha: v1.25
@ -972,9 +966,5 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
genericfeatures.KMSv1: {Default: false, PreRelease: featuregate.Deprecated},
// features with duplicate definition in apiserver/controller-manager
CloudControllerManagerWebhook: {Default: false, PreRelease: featuregate.Alpha},
InPlacePodVerticalScaling: {Default: false, PreRelease: featuregate.Alpha},
}

View File

@ -21,6 +21,7 @@ import (
"k8s.io/apimachinery/pkg/util/version"
genericfeatures "k8s.io/apiserver/pkg/features"
"k8s.io/component-base/featuregate"
kcmfeatures "k8s.io/controller-manager/pkg/features"
)
// defaultVersionedKubernetesFeatureGates consists of all known Kubernetes-specific feature keys with VersionedSpecs.
@ -64,6 +65,10 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
{Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha},
},
kcmfeatures.CloudControllerManagerWebhook: {
{Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha},
},
ClusterTrustBundle: {
{Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha},
},

View File

@ -17,6 +17,7 @@ limitations under the License.
package features
import (
"k8s.io/apimachinery/pkg/util/version"
"k8s.io/component-base/featuregate"
)
@ -39,12 +40,14 @@ const (
CloudControllerManagerWebhook featuregate.Feature = "CloudControllerManagerWebhook"
)
func SetupCurrentKubernetesSpecificFeatureGates(featuregates featuregate.MutableFeatureGate) error {
return featuregates.Add(cloudPublicFeatureGates)
func SetupCurrentKubernetesSpecificFeatureGates(featuregates featuregate.MutableVersionedFeatureGate) error {
return featuregates.AddVersioned(versionedCloudPublicFeatureGates)
}
// cloudPublicFeatureGates consists of cloud-specific feature keys.
// To add a new feature, define a key for it at k8s.io/api/pkg/features and add it here.
var cloudPublicFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
CloudControllerManagerWebhook: {Default: false, PreRelease: featuregate.Alpha},
// versionedCloudPublicFeatureGates consists of versioned cloud-specific feature keys.
// To add a new feature, define a key for it above and add it here.
var versionedCloudPublicFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{
CloudControllerManagerWebhook: {
{Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha},
},
}

View File

@ -1,9 +1,3 @@
- name: CloudControllerManagerWebhook
versionedSpecs:
- default: false
lockToDefault: false
preRelease: Alpha
version: ""
- name: ComponentSLIs
versionedSpecs:
- default: true

View File

@ -146,6 +146,12 @@
lockToDefault: false
preRelease: Alpha
version: "1.31"
- name: CloudControllerManagerWebhook
versionedSpecs:
- default: false
lockToDefault: false
preRelease: Alpha
version: "1.27"
- name: ClusterTrustBundle
versionedSpecs:
- default: false