The idea is to make apples-to-apples comparison easier by having one benchmark implementation each
for Encode and Decode, and parameterizing with a runtime.Serializer and a []runtime.Object (to vary
the concrete type and contents).
Align internal TokenRequestSpec.ExpirationSeconds with staging v1 (*int64) and mark UserInfo conversions copy-only so conversion-gen emits direct unsafe.Pointer casts.
The one use was a type assertion; runtime now exports the same OpenAPIModelNamer interface, and a k/k test keeps it identical to kube-openapi's.
kube-openapi leaves the go.mod of api, cluster-bootstrap, csi-translation-lib, kube-controller-manager, kube-proxy and kubelet.
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
to new lifecycle group
- EvictionRequest is managed by a requester
- Eviction is managed by the evictionrequest-controller
- add storage, strategy, printers and validation
- enum: check every rule's option so an undefined option always errors, matching IfOption
- operation.Options: note an option can be enabled even when its feature gate is off
- api/testing: fall back to strategy options only when the caller supplied none
HPA, workload, and PodGroup strategies declare their options as map[string]bool,
and the versioned validation-equivalence sweep is given each strategy's declared
options so referenced options are not treated as undeclared.
Add FilterCoveredHandwrittenErrors and FilterEnforcedDeclarativeErrors helpers to pkg/api/validate in a dedicated errors.go file for reuse across declarative validation pathways.
TestVersionedValidationByFuzzing swept a hand-maintained list of
group/versions that had a typo (network.k8s.io) and omitted several
groups (apps, policy, rbac, flowcontrol, scheduling). Replace it with a
sweep of the scheme for served GVKs that have declarative validation,
so new group/versions are covered automatically.
Skip extensions/v1beta1 centrally in VerifyVersionedValidationEquivalence
instead of via the per-call WithSkipGroupVersions option: it opts out of
declarative validation but shares an internal type with versions that do
not. Any other version missing declarative validation now fails the sweep
rather than being silently skipped.
The gate is GA and locked to true, so explicitly setting it in the
equivalence test harness only emits a 'setting GA feature gate' warning
without changing behavior. Rely on its locked default instead.
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\""
...
When a test enables a feature gate introduced after 1.35, the "hand
written validation" sub-test fails because SetFeatureGateEmulationVersionDuringTest
cannot downgrade to 1.35 for features that did not exist at that version.
This adds a WithMinEmulationVersion option so callers can declare the
minimum supported emulation version and skip the sub-test when incompatible.
- Register v1 MutatingAdmissionPolicy and Binding in apiserver storage.
- Add defaults and validation for v1 types.
- Update storage version hash data.
- Add API testdata.
- Test scenarios: Beta Enabled, Beta Disabled, and Legacy (emulated 1.35).
- Remove deprecated Takeover gate references and redundant coverage checks.
- Add TODO to remove legacy emulation in 1.39.
- Update documentation to match the new Validation Lifecycle strategy.