498 Commits
Author SHA1 Message Date
Ben Luddy 5e92c6107c Add table-based Serializer benchmarks.
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).
2026-11-04 17:15:13 -05:00
Antoni Zawodny b5bc747913 Promote CompositePodGroup API to beta 2026-10-28 08:11:40 +01:00
Jordan Liggitt fbc5386508 Cleanup inactive approvers 2026-10-22 13:34:00 -04:00
Lucas Käldström 71b4ddbb6e Add AuthorizationConditionsReview API 2026-10-09 19:41:19 +03:00
Lucas Käldström 6a16cacba1 Add spec.authorizationOptions and status.conditionalDecision to SubjectAccessReview types
Signed-off-by: Lucas Käldström <luxask@amazon.fi>
2026-10-09 19:37:57 +03:00
Lucas KäldströmandJordan Liggitt 9327ba3797 Ignore validation errors from other API versions without specific fields
Co-authored-by: Jordan Liggitt <liggitt@google.com>
2026-10-08 19:54:21 +03:00
Michael Aspinwall ccd2ca6f45 authentication: enable instant cast for TokenRequest
Align internal TokenRequestSpec.ExpirationSeconds with staging v1 (*int64) and mark UserInfo conversions copy-only so conversion-gen emits direct unsafe.Pointer casts.
2026-10-06 17:11:36 +00:00
Michael Aspinwall 2673d42ba7 pkg/api/testing: add TestMemoryIdenticalConversion across all API types 2026-10-05 23:45:25 +00:00
Davanum Srinivas 53cbfe3e4b apimachinery: drop the kube-openapi import from runtime/scheme.go
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>
2026-10-01 12:01:18 -04:00
Filip Křepinský fc558fb4e9 introduce EvictionRequest and Eviction API
to new lifecycle group

- EvictionRequest is managed by a requester
- Eviction is managed by the evictionrequest-controller
- add storage, strategy, printers and validation
2026-07-22 21:32:12 +02:00
Antoni Zawodny 54f6446af1 Add DisruptionMode and PreemptionPolicy fields to the CompositePodGroup API 2026-07-22 09:00:32 +02:00
tinatingyu 57c6b19abb Promote PodCertificateRequest to GA (v1)
TAG=agy
CONV=723dea2c-bfd6-42fc-a230-4d238ac6191c
2026-07-21 17:17:06 +00:00
Antoni Zawodny 3ddd5a74e6 Graduate WAS APIs to beta 2026-07-21 12:56:46 +00:00
Yongrui Lin 7c3452f8d3 address comments: enum undefined-option check, options doc, test fallback
- 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
2026-07-14 16:43:29 +00:00
Yongrui Lin caf5bd0b70 declarative validation: declare strategy options as maps
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.
2026-07-14 16:43:29 +00:00
Lalit Chauhan 5160114ab7 apimachinery: Centralize declarative error helpers in errors.go
Add FilterCoveredHandwrittenErrors and FilterEnforcedDeclarativeErrors helpers to pkg/api/validate in a dedicated errors.go file for reuse across declarative validation pathways.
2026-07-08 20:23:15 +00:00
Patrick Ohly 1acfb8e8fc DRA: add DeviceTaintRule to v1 API 2026-07-06 20:15:27 +02:00
Yongrui Lin 4dabaebe45 api/testing: auto-discover declarative-validation GVKs in fuzz test
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.
2026-07-01 17:07:29 +00:00
Yongrui Lin ae16b61ccf Stop setting locked GA DeclarativeValidation gate in DV tests
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.
2026-06-26 21:17:13 +00:00
Lalit Chauhan ae2801a7bf Change DV test util accordingly 2026-06-24 16:29:48 +00:00
kubernetes-prow[bot] dda2e89631 Merge pull request #139568 from lalitc375/configure-dv-part1a
Setup ObjectMeta test suite and wire it for AdmissionRegistration API group
2026-06-22 20:25:52 +00:00
Aman Shrivastava 3b485f67e8 Skip extensions/v1beta1 in autoscaling Scale validation equivalence tests 2026-06-16 16:03:49 +05:30
Lalit Chauhan 8dc4ad1d5c Add valid test cases to ObjectMeta DV test suite
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.
2026-06-15 14:59:25 -07:00
Lalit Chauhan 755ccb3dae Add objectMeta validation in the path of DV testing 2026-06-15 21:22:30 +00:00
Yongrui Lin e4cc8f8e9d testing: skip unserved extensions/v1beta1 in validation equivalence sweep
Add WithSkipGroupVersions and apply it to the NetworkPolicy and Scale tests,
whose internal types also register under the now-unvalidated extensions/v1beta1.
2026-06-11 06:35:35 +00:00
dom4ha 88948acc38 Remove v1alpha2 API definitions
Update client-go lister and informer imports to v1alpha3
2026-05-22 12:50:19 +00:00
Yongrui Lin 44f6df54da Drop legacy hand-written validation subtest from pkg/api/testing
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.
2026-05-20 18:54:07 +00:00
Yongrui Lin 16a17be014 pkg/api/testing: add VerifyUpdateValidationEquivalenceFunc
Variant of VerifyUpdateValidationEquivalence that accepts a validate
closure instead of a RESTUpdateStrategy, for callers that produce
handwritten and declarative validation errors directly.
2026-05-13 20:07:12 +00:00
Jordan Liggitt ef2e578f14 switch tag Get("json") to Lookup("json") 2026-05-13 11:24:07 -04:00
Yongrui Lin 3577cbda2f pkg/api/testing: record observed rules during DV equivalence tests
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.
2026-05-09 18:59:16 +00:00
Lalit Chauhan a1a5b10127 Address comments 2026-05-02 00:09:59 +00:00
Lalit Chauhan 68ad19102c Fix testing utils 2026-05-02 00:09:59 +00:00
Joe Betz 1fafa91da4 Consolidate DeclarativeValidationStrategy interface 2026-04-27 19:26:25 -04:00
Joe Betz 30c76c1879 Make declarative validation part of strategies 2026-04-24 12:00:41 -04:00
Antoni ZawodnyandOmar Sayed 59c9f75133 Add Workload-Aware Preemption fields to Workload and PodGroup APIs
Co-authored-by: Omar Sayed <omarsayed@google.com>
2026-03-24 09:03:50 +01:00
Nour 29601b8628 Add ResourcePoolStatusRequest API types and generated code
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.
2026-03-19 16:49:56 +02:00
Antoni Zawodny d879ee4761 Remove v1alpha1 scheduling API from the API defaulting test 2026-03-14 08:46:57 +01:00
Patrick Ohly 566dc7f3f3 DRA device taints: graduate to beta
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\""
            ...
2026-03-12 18:26:02 +01:00
Kubernetes Prow Robot 8275484dcf Merge pull request #137297 from atombrella/feature/pkg_forvar_modernize
Remove redundant variable re-assignment in for-loops under pkg
2026-03-05 00:28:20 +05:30
Mads Jensen f11bb48738 Remove redundant re-assignment in for-loops under pkg
This the forvar rule from modernize. The semantics of the for-loop
changed from Go 1.22 to make this pattern obsolete.
2026-03-02 08:47:43 +01:00
yongruilin 9454a3069b Add WithMinEmulationVersion option to skip hand-written validation sub-test
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.
2026-02-26 21:36:40 +00:00
Your Name 3b5298f0a4 Fix resource claim DV 2026-02-24 18:36:47 +00:00
Your Name 12a6d300c6 Change strategy.go utils to mark handwritten validation errors properly 2026-02-24 18:33:14 +00:00
Lalit Chauhan b7c4f21d41 promote MutatingAdmissionPolicy to v1: api wiring and validation
- Register v1 MutatingAdmissionPolicy and Binding in apiserver storage.
- Add defaults and validation for v1 types.
- Update storage version hash data.
- Add API testdata.
2026-02-18 17:51:43 +00:00
yongruilin 33dec2246f address feedback: refactor declarative validation migration checks
- Extract HV error filtering into filterHandwrittenErrors for readability.
- Simplify errOutputMatcherByStability initialization in testing helpers.
2026-02-13 00:54:18 +00:00
yongruilin 93b901d177 Enhance validation testing: add support for all declarative rules enforcement 2026-02-13 00:54:18 +00:00
yongruilin 4f56a298cc Enforce zero mismatches in validation equivalence testing 2026-02-13 00:54:18 +00:00
yongruilin 2ef358870a Update validation equivalence testing for lifecycle enforcement
- 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.
2026-02-13 00:54:18 +00:00
Kubernetes Prow Robot c8e45a3331 Merge pull request #136620 from yongruilin/master_vg-fix-fuzz
fix DeclarativeValidation fuzzing test panic and refactor subresource handlin
2026-01-30 03:08:04 +05:30
Kubernetes Prow Robot 3760cdc64a Merge pull request #136482 from aaron-prindle/dv-feature-gate-ga
Graduate DeclarativeValidation feature gate to GA
2026-01-30 03:07:48 +05:30