@@ -17,8 +17,16 @@ import (
17
17
18
18
var defaultGroupVersionsByFeatureGate = map [configv1.FeatureGateName ][]groupVersionByOpenshiftVersion {
19
19
"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" }},
22
30
},
23
31
"DynamicResourceAllocation" : {
24
32
{KubeVersionRange : semver .MustParseRange ("< 1.31.0" ), GroupVersion : schema.GroupVersion {Group : "resource.k8s.io" , Version : "v1alpha2" }},
62
70
// either will only be set if both can be successfully set. Otherwise, the existing config is
63
71
// returned pruned but otherwise unmodified.
64
72
func NewFeatureGateObserverWithRuntimeConfig (featureWhitelist sets.Set [configv1.FeatureGateName ], featureBlacklist sets.Set [configv1.FeatureGateName ], featureGateAccessor featuregates.FeatureGateAccess , groupVersionsByFeatureGate map [configv1.FeatureGateName ][]schema.GroupVersion ) configobserver.ObserveConfigFunc {
65
-
66
73
featureGateObserver := featuregates .NewObserveFeatureFlagsFunc (
67
74
featureWhitelist ,
68
75
featureBlacklist ,
0 commit comments