feature: promote CRDValidationRatcheting to beta

also fixup test which needs feature to be disabled
it was set to enable by default in this CL
This commit is contained in:
Alexander Zielenski 2023-10-23 17:53:42 -07:00
parent 02aaad0de9
commit 768c169dd8
3 changed files with 5 additions and 2 deletions

View File

@ -1212,7 +1212,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
// inherited features from apiextensions-apiserver, relisted here to get a conflict if it is changed
// unintentionally on either side:
apiextensionsfeatures.CRDValidationRatcheting: {Default: false, PreRelease: featuregate.Alpha},
apiextensionsfeatures.CRDValidationRatcheting: {Default: true, PreRelease: featuregate.Beta},
// features that enable backwards compatibility but are scheduled to be removed
// ...

View File

@ -44,5 +44,5 @@ func init() {
// To add a new feature, define a key for it above and add it here. The features will be
// available throughout Kubernetes binaries.
var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
CRDValidationRatcheting: {Default: false, PreRelease: featuregate.Alpha},
CRDValidationRatcheting: {Default: true, PreRelease: featuregate.Beta},
}

View File

@ -1952,6 +1952,8 @@ func BenchmarkRatcheting(b *testing.B) {
}
func TestRatchetingDropFields(t *testing.T) {
// Field dropping only takes effect when feature is disabled
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.CRDValidationRatcheting, false)()
tearDown, apiExtensionClient, _, err := fixtures.StartDefaultServerWithClients(t)
if err != nil {
t.Fatal(err)
@ -1982,6 +1984,7 @@ func TestRatchetingDropFields(t *testing.T) {
Type: "string",
XValidations: []apiextensionsv1.ValidationRule{
{
// Results in error if field wasn't dropped
Rule: "self == oldSelf",
OptionalOldSelf: ptr(true),
},