Skip to content

Commit 989d68d

Browse files
committed
chore: update DeclarativeValidation featuregate
1 parent a38d4e5 commit 989d68d

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

pkg/features/kube_features.go

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,27 @@ 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:
153+
// owner: @jpbetz @aaron-prindle @yongruilin
154+
// kep: http://kep.k8s.io/5073
155155
// beta: v1.33
156156
//
157-
// Enable declarative validation of APIs, where declared.
157+
// Enables running declarative validation of APIs, where declared. When enabled, APIs with
158+
// declarative validation rules will validate objects using the generated
159+
// declarative validation code and compare the results to the regular imperative validation.
160+
// See DeclarativeValidationTakeover for more.
158161
DeclarativeValidation featuregate.Feature = "DeclarativeValidation"
159162

160-
// owner: @thockin
161-
// kep: http://kep.k8s.io/5073:
163+
// owner: @jpbetz @aaron-prindle @yongruilin
164+
// kep: http://kep.k8s.io/5073
162165
// beta: v1.33
163166
//
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+
// When enabled, declarative validation errors are returned directly to the caller,
168+
// replacing hand-written validation errors for rules that have declarative implementations.
169+
// When disabled, hand-written validation errors are always returned, effectively putting
170+
// declarative validation in a "shadow mode" that monitors but does not affect API responses.
171+
// Note: Although declarative validation aims for functional equivalence with hand-written validation,
172+
// the exact number, format, and content of error messages may differ between the two approaches.
173+
DeclarativeValidationTakeover featuregate.Feature = "DeclarativeValidationTakeover"
167174

168175
// owner: @atiratree
169176
// kep: http://kep.k8s.io/3973

pkg/features/versioned_kube_features.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
148148
{Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta},
149149
},
150150

151-
DeclarativeValidationMismatchMetric: {
151+
DeclarativeValidationTakeover: {
152152
{Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta},
153153
},
154154

test/featuregates_linter/test_data/versioned_feature_list.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@
380380
lockToDefault: false
381381
preRelease: Beta
382382
version: "1.33"
383-
- name: DeclarativeValidationMismatchMetric
383+
- name: DeclarativeValidationTakeover
384384
versionedSpecs:
385385
- default: false
386386
lockToDefault: false

0 commit comments

Comments
 (0)