Address review feedback on PR #139568:
- Group all test cases by the ObjectMeta field they cover (the stray
"finalizers: name too long" case previously sat at the bottom).
- Mirror the field grouping in the update suite. The update suite keeps
only the baseline valid case; field-level boundaries are covered by
the create suite and re-checking them on update adds no signal.
- Fix three errorlint warnings flagged by pull-kubernetes-linter-hints:
switch fmt.Errorf("...: %v", err) to %w in the metadata-accessor
failure paths of rest.ValidateCreate and validateCommonFields.
- Reword the extensions/v1beta1 skip comment in
TestVersionedValidationByFuzzing: drop the stray trailing semicolon
and explain that the group is unserved and does not carry DV.
Add WithSkipGroupVersions and apply it to the NetworkPolicy and Scale tests,
whose internal types also register under the now-unvalidated extensions/v1beta1.
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.
Variant of VerifyUpdateValidationEquivalence that accepts a validate
closure instead of a RESTUpdateStrategy, for callers that produce
handwritten and declarative validation errors directly.
VerifyValidationEquivalence's all-rules-enforced subtest now extracts
the GVK from the request context and forwards each error to
coverage.RecordObservedRules so AssertDeclarativeCoverage (in the
generated TestMain) can confirm every declared rule fired.
Introduce the ResourcePoolStatusRequest resource type in the
resource.k8s.io/v1alpha3 API group, gated behind the
DRAResourcePoolStatus feature gate. This includes external and internal
type definitions, protobuf/OpenAPI generated code, client-go typed
clients, informers, listers, apply configurations, deepcopy, defaults,
conversion, fuzzer, declarative validation tags, and API discovery
metadata.
The fields become beta, enabled by default. DeviceTaintRule gets
added to the v1beta2 API, but support for it must remain off by default
because that API group is also off by default.
The v1beta1 API is left unchanged. No-one should be using it
anymore (deprecated in 1.33, could be removed now if it wasn't for
reading old objects and version emulation).
To achieve consistent validation, declarative validation must be enabled also
for v1alpha3 (was already enabled for other versions). Otherwise,
TestVersionedValidationByFuzzing fails:
--- FAIL: TestVersionedValidationByFuzzing (0.09s)
--- FAIL: TestVersionedValidationByFuzzing/resource.k8s.io/v1beta2,_Kind=DeviceTaintRule (0.00s)
validation_test.go:109: different error count (0 vs. 1)
resource.k8s.io/v1alpha3: <no errors>
resource.k8s.io/v1beta2: "spec.taint.effect: Unsupported value: \"幤HxÒQP¹¬永唂ȳ垞ş]嘨鶊\": supported values: \"NoExecute\", \"NoSchedule\", \"None\""
...