Add WithSkipGroupVersions and apply it to the NetworkPolicy and Scale tests,
whose internal types also register under the now-unvalidated extensions/v1beta1.
* Wire up Secret for declarative validation
* Migrate Secret.Type to declarative immutable validation
* Add +k8s:optional tag to Secret.Type field
* Add TestDeclarativeValidate test for CREATE flow
* Add immutability test cases for unset->set and set->unset
* Fix ValidateDeclarativelyWithMigrationChecks call to include DeclarativeValidationConfig
* Fix double declarative validation by removing manual ValidateDeclarativelyWithMigrationChecks calls
The secret strategy embedded rest.DeclarativeValidation (which implements
DeclarativeValidationStrategy) but also called ValidateDeclarativelyWithMigrationChecks
directly inside Validate and ValidateUpdate. The REST handler and test framework
call ValidateDeclaratively separately after Validate/ValidateUpdate, causing
double execution that broke the AllDeclarativeEnforced test scenario.
Fix by returning only handwritten errors from Validate/ValidateUpdate, matching
the pattern used by csiDriverStrategy and other correctly-migrated strategies.
* Use alpha stability level for +k8s:immutable on Secret.Type
The validation-gen tool enforces that Beta-level tags cannot be used in
Stable validation. Change +k8s:immutable to
+k8s:alpha(since: "1.36")=+k8s:immutable to match other stable-API fields.
Regenerate zz_generated.validations.go and update test expected errors
with .MarkAlpha() accordingly.
* Update alpha stability level version from 1.36 to 1.37
Update +k8s:alpha(since: "1.36") annotations to 1.37 in types.go
and generated.proto for Secret.Type immutability and ReplicationController
declarative validation tags.
* Regenerate zz_generated.validations.go after rebase
Rebase onto latest master brought in validation-gen changes that add
.MarkShortCircuit() to immutable and optional field validations.
* Add generated declarative validation test files for Secret
validation-gen generates test/declarative_validation/core/secret/
as part of Secret declarative validation wiring.
* Add declarative validation coverage test for Secret.type immutability
The coverage checker requires all registered validation rules to be
exercised by tests. Add a test that triggers the immutable validation
error for Secret.type to satisfy coverage for the generated rule:
v1, Kind=Secret: type FieldValueInvalid origin="immutable"
* Move Secret declarative validation tests to test/declarative_validation
Move all test cases from pkg/registry/core/secret/declarative_validation_test.go
to test/declarative_validation/core/secret/declarative_validation_test.go
per #138872, and remove the original file.
* Revert ReplicationController alpha tags from 1.37 back to 1.36
The since: "1.36" tags on ReplicationController fields track when those
tags were originally added (v1.36) and should not have been changed.
Only the newly added Secret.Type immutable tag targets 1.37.
Removes BackoffLimitPerIndex/MaxFailedIndexes defaults from validJobSpec
and adds tweakMaxFailedIndexes. Test cases now pass both tweaks
explicitly, matching cronjob's style — the truth table is visible at
the test case rather than hidden in the fixture.
Adds a parity test for Job (new test/declarative_validation/batch/job
directory) and a case under cronjob exercising the
spec.jobTemplate.spec.backoffLimitPerIndex path.
With DV always enforced, the "hand written validation" subtest (which
set DeclarativeValidation=off and emulated 1.35) now exercises the
same code path as "Beta disabled". Remove it along with the
MinEmulationVersion option, the WithMinEmulationVersion helper,
deDuplicateErrors, and the now-tautological imperative-vs-declarative
equivalence checks.
Add declarative_validation_test.go under autoscaling/scale/ and apps/scale/
that invoke ValidateScaleUpdate via VerifyUpdateValidationEquivalenceFunc.
The tests observe the rules declared by the generated fixtures, satisfying
AssertDeclarativeCoverage for autoscaling/v1.Scale, apps/v1beta1.Scale,
and apps/v1beta2.Scale.
Remove the autoscaling/v1.Scale, apps/v1beta1.Scale, and apps/v1beta2.Scale
entries from coverage-allowlist.yaml, then regenerate declarative-validation
test fixtures so the corresponding RegisterDeclaredRules calls and TestMain
files are emitted under autoscaling/scale/ and apps/scale/.
Move the existing declarative_validation_test.go files out of
pkg/registry/ into a top-level tree at
test/declarative_validation/<group>/<kind>/. The new location pairs
each hand-written test with the per-Kind TestMain and version-init
files emitted by validation-gen, so the coverage gate runs alongside
the equivalence checks and apiVersions no longer needs to be
hand-maintained.
Pass -test-output-root and -test-allowlist to validation-gen so the
per-Kind coverage fixtures regenerate alongside the validators. Add the
allowlist YAML at test/declarative_validation/coverage-allowlist.yaml.