Skip to content

Commit 0125bc1

Browse files
authored
Merge pull request kubernetes#130478 from aaron-prindle/add-declarative-validation-feature-gates
feat: add DeclarativeValidation and DeclarativeValidationMismatchMetric feature gates
2 parents df030f3 + 3010618 commit 0125bc1

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

pkg/features/kube_features.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,21 @@ const (
150150
// Enable usage of Provision of PVCs from snapshots in other namespaces
151151
CrossNamespaceVolumeDataSource featuregate.Feature = "CrossNamespaceVolumeDataSource"
152152

153+
// owner: @thockin
154+
// kep: http://kep.k8s.io/5073:
155+
// beta: v1.33
156+
//
157+
// Enable declarative validation of APIs, where declared.
158+
DeclarativeValidation featuregate.Feature = "DeclarativeValidation"
159+
160+
// owner: @thockin
161+
// kep: http://kep.k8s.io/5073:
162+
// beta: v1.33
163+
//
164+
// Enable declarative_validation_mismatch metric which outputs # of mismatch occurrences between
165+
// hand-written and declarative validation rules.
166+
DeclarativeValidationMismatchMetric featuregate.Feature = "DeclarativeValidationMismatchMetric"
167+
153168
// owner: @atiratree
154169
// kep: http://kep.k8s.io/3973
155170
//

pkg/features/versioned_kube_features.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
144144
{Version: version.MustParse("1.32"), Default: true, LockToDefault: true, PreRelease: featuregate.GA},
145145
},
146146

147+
DeclarativeValidation: {
148+
{Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta},
149+
},
150+
151+
DeclarativeValidationMismatchMetric: {
152+
{Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta},
153+
},
154+
147155
DeploymentPodReplacementPolicy: {
148156
{Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha},
149157
},

test/featuregates_linter/test_data/versioned_feature_list.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,18 @@
364364
lockToDefault: true
365365
preRelease: GA
366366
version: "1.32"
367+
- name: DeclarativeValidation
368+
versionedSpecs:
369+
- default: false
370+
lockToDefault: false
371+
preRelease: Beta
372+
version: "1.33"
373+
- name: DeclarativeValidationMismatchMetric
374+
versionedSpecs:
375+
- default: false
376+
lockToDefault: false
377+
preRelease: Beta
378+
version: "1.33"
367379
- name: DeploymentPodReplacementPolicy
368380
versionedSpecs:
369381
- default: false

0 commit comments

Comments
 (0)