@@ -17,8 +17,16 @@ import (
1717
1818var defaultGroupVersionsByFeatureGate = map [configv1.FeatureGateName ][]groupVersionByOpenshiftVersion {
1919 "MutatingAdmissionPolicy" : {
20- {KubeVersionRange : semver .MustParseRange ("< 1.34.0" ), GroupVersion : schema.GroupVersion {Group : "admissionregistration.k8s.io" , Version : "v1alpha1" }},
21- {KubeVersionRange : semver .MustParseRange (">= 1.34.0" ), GroupVersion : schema.GroupVersion {Group : "admissionregistration.k8s.io" , Version : "v1beta1" }},
20+ // Both v1alpha1 and v1beta1 versions must be served pre-GA because e2e tests exercise both APIs.
21+ // A GA OpenShift release could inadvertently serve these versions if MutatingAdmissionPolicy
22+ // gets added to the default featureSet in openshift/api as part of transitioning from
23+ // (feature off, v1beta1 off) to (feature on, v1 on).
24+ // To prevent that, version ranges below include min and max bounds.
25+ // TODO: Update version ranges when rebasing to k8s v1.35+
26+ // - If v1 resources are available in 1.35: remove all MutatingAdmissionPolicy references
27+ // - If no v1 resources: bump ranges to "<1.36.0" and reassess in next rebase
28+ {KubeVersionRange : semver .MustParseRange (">=1.33.0 <1.35.0" ), GroupVersion : schema.GroupVersion {Group : "admissionregistration.k8s.io" , Version : "v1alpha1" }},
29+ {KubeVersionRange : semver .MustParseRange (">=1.34.0 <1.35.0" ), GroupVersion : schema.GroupVersion {Group : "admissionregistration.k8s.io" , Version : "v1beta1" }},
2230 },
2331 "DynamicResourceAllocation" : {
2432 {KubeVersionRange : semver .MustParseRange ("< 1.31.0" ), GroupVersion : schema.GroupVersion {Group : "resource.k8s.io" , Version : "v1alpha2" }},
6270// either will only be set if both can be successfully set. Otherwise, the existing config is
6371// returned pruned but otherwise unmodified.
6472func NewFeatureGateObserverWithRuntimeConfig (featureWhitelist sets.Set [configv1.FeatureGateName ], featureBlacklist sets.Set [configv1.FeatureGateName ], featureGateAccessor featuregates.FeatureGateAccess , groupVersionsByFeatureGate map [configv1.FeatureGateName ][]schema.GroupVersion ) configobserver.ObserveConfigFunc {
65-
6673 featureGateObserver := featuregates .NewObserveFeatureFlagsFunc (
6774 featureWhitelist ,
6875 featureBlacklist ,
0 commit comments