Skip to content

Commit aaf8f8b

Browse files
Merge pull request #1927 from bertinatto/mutatingadmissionpolicy-v1alpha1
OCPSTRAT-2371: MutatingAdmissionPolicy e2es depend on both v1alpha1 and v1beta1 of admissionregistration.k8s.io being served in k8 1.34
2 parents 6333489 + 03b528d commit aaf8f8b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/operator/configobservation/apienablement/observe_runtime_config.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,16 @@ import (
1717

1818
var 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"}},
@@ -62,7 +70,6 @@ var (
6270
// either will only be set if both can be successfully set. Otherwise, the existing config is
6371
// returned pruned but otherwise unmodified.
6472
func 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

Comments
 (0)