Skip to content

Commit 3010618

Browse files
committed
feat: add DeclarativeValidation and DeclarativeValidationMismatchMetric feature gates
1 parent 807d22f commit 3010618

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
@@ -153,6 +153,21 @@ const (
153153
// Enable usage of Provision of PVCs from snapshots in other namespaces
154154
CrossNamespaceVolumeDataSource featuregate.Feature = "CrossNamespaceVolumeDataSource"
155155

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

pkg/features/versioned_kube_features.go

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

152+
DeclarativeValidation: {
153+
{Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta},
154+
},
155+
156+
DeclarativeValidationMismatchMetric: {
157+
{Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta},
158+
},
159+
152160
DeploymentPodReplacementPolicy: {
153161
{Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha},
154162
},

test/featuregates_linter/test_data/versioned_feature_list.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,18 @@
374374
lockToDefault: true
375375
preRelease: GA
376376
version: "1.32"
377+
- name: DeclarativeValidation
378+
versionedSpecs:
379+
- default: false
380+
lockToDefault: false
381+
preRelease: Beta
382+
version: "1.33"
383+
- name: DeclarativeValidationMismatchMetric
384+
versionedSpecs:
385+
- default: false
386+
lockToDefault: false
387+
preRelease: Beta
388+
version: "1.33"
377389
- name: DeploymentPodReplacementPolicy
378390
versionedSpecs:
379391
- default: false

0 commit comments

Comments
 (0)