Commit graph

450 commits

Author SHA1 Message Date
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
yongruilin
fbefdc816f refactor subresource handling in versioned validation fuzz tests
Refactor TestVersionedValidationByFuzzing to use a declarative map,
subresourceOnly, for resources that must be validated via a specific
subresource path (like autoscaling/Scale).

GVKs not in this map default to root-level validation (""), which is
sufficient for resources that share validation logic between their root
and subresources. This replaces the previous ad-hoc special-casing
with a cleaner, extensible mapping.
2026-01-29 10:30:12 +00:00
yongruilin
64140b8385 fuzz internal objects in versioned validation tests
Fuzzing must be performed on the internal version of objects because
custom fuzzing functions are typically registered for internal types.
This ensures that all fields are properly initialized with random values
before being converted to various API versions for validation.

Move fuzzing logic into VerifyVersionedValidationEquivalence via a new
WithFuzzer option. This also fixes a panic that occurred when attempting
to fuzz types without an internal version (e.g., APIGroupList) by adding
a nil check after internal conversion.
2026-01-29 10:29:55 +00:00
Aaron Prindle
0cab277183 Graduate DeclarativeValidation feature gate to GA
This change graduates the 'DeclarativeValidation' feature gate to GA in v1.36.
The feature gate is now locked to 'true' by default.

Changes:
- Updated 'DeclarativeValidation' feature gate to GA in 'pkg/features/kube_features.go' and 'staging/src/k8s.io/apiserver/pkg/features/kube_features.go'.
- Updated feature gate documentation and versioned lists via 'hack/update-featuregates.sh'.
- Added feature gate emulation versioning to tests that explicitly disable 'DeclarativeValidation' to prevent panics now that the gate is locked to default.
2026-01-29 05:38:20 +00:00
darshansreenivas
0b635116f1 feat(admissionregistration): enable declarative validation wiring and require ValidationActions 2026-01-24 03:46:24 -08:00
Kubernetes Prow Robot
5eb7087ccb
Merge pull request #135761 from darshansreenivas/admissionregistratio_k8s_io_policy_name
feat: wire admissionregistration group for declarative validation and +k8s:required to ValidatingAdmissionPolicyBindingSpec.PolicyName
2026-01-24 10:33:31 +05:30
darshansreenivas
04ea1eabff feat(admissionregistration): wire group for declarative validation and require PolicyName 2026-01-22 11:19:22 -08:00
Kubernetes Prow Robot
f4ed7b3e28
Merge pull request #135951 from droach282/cronjob-schedule-dv
Adding declarative validations to CronJob Schedule field
2026-01-16 17:18:49 +05:30
Dan Roach
5b5cc2d498 Adding declarative validations to CronJob 2026-01-15 14:05:15 -07:00
Lalit Chauhan
c3fecccd3e Make sure errors present in declarative validation test files are DV errors 2026-01-15 17:42:02 +00:00
CLBRITTON2
a6618afc29 Wire discovery v1/v1beta1 for fuzz testing 2026-01-09 11:54:51 -05:00
Lalit Chauhan
55041b832f Bring the changes back which was removed due to accident in #134909 2026-01-09 00:02:41 +00:00
Darshan Murthy
1c24a05ce1
wire network group for declarative validation and +k8s:required to IngressClassParametersReference.Name and IngressClassParametersReference.Kind (#134909) 2026-01-09 03:11:43 +05:30
Lalit Chauhan
4e6aafb9b3 Address feedbacks 2026-01-06 18:38:35 +00:00
Lalit Chauhan
e83723ce2c Add ignoreConversionErrors option to validation testing
This commit adds an 'IgnoreObjectConversionErrors' option to the
validation testing framework in 'k8s.io/apimachinery' and exposes it
via 'pkg/api/testing'.

This is useful for fuzzing tests where we might want to skip object
versions that cannot be converted from the internal version (e.g. due to
missing fields or incompatible types in older versions) but still want
to test validation for the versions that *can* be converted.

The 'autoscaling' group versions are added to 'TestVersionedValidationByFuzzing'
with this option enabled.
2026-01-06 18:23:26 +00:00
darshansreenivas
897adb7b48 DRA: adding tag to node module
move DRA to a update method

fix boilerplate code

apply node normalize code at fuzz logic

adding normalization fix

fix nit
2025-12-04 23:03:21 -08:00
Lalit Chauhan
ee481b97e0 fix sorting logic after after normalizing errors 2025-11-06 06:17:49 +00:00
tinatingyu
59e075e8d3 Promote PodCertificateRequests to v1beta1 2025-11-02 05:33:44 +00:00
darshansreenivas
4a9a010c53 adding back v1alpha1 2025-10-28 14:58:43 -07:00
darshansreenivas
68710ce086 add declarative validation test
- restore v1alpha1
- fix lint issues
- ensure tests run with valid objects
2025-10-28 14:56:10 -07:00
darshansreenivas
2e257dffd8 update code-gen for new tags and ignore v1alpha1 2025-10-28 14:53:54 -07:00
Joe Betz
bd6fb65f83 Reduce fuzz test runs by 10x to avoid timeouts 2025-10-21 10:13:04 -04:00
Aaron Prindle
9d83f71cde fix validation_test.go to use path normalization 2025-10-16 17:40:19 +00:00
Kubernetes Prow Robot
db63a581ca
Merge pull request #134366 from tallclair/feature-gates-test
Set multiple feature gates simultaneously in test
2025-10-13 13:11:33 -07:00
yongruilin
6965075ebd Address feedback: simpliy errormatcher instantiation 2025-10-06 17:54:03 +00:00
yongruilin
ae8ea8994e feat(validation): Enhance validation tests with normalization rules support 2025-10-04 03:28:52 +00:00
Tim Allclair
4986abe0b8 Automated refactoring to use SetFeatureGatesDuringTest 2025-10-01 21:10:53 -07:00
yongruilin
96349a4608 chore: Move declarative validation featuregates to staging apiserver 2025-09-26 22:30:16 +00:00
Lalit Chauhan
3015e58e40 Improve tests devex for DV tests. 2025-09-25 17:29:30 +00:00
Jordan Liggitt
840aa4722e
Drop unnecessary gogo dependencies 2025-09-23 13:44:20 -04:00
Kubernetes Prow Robot
ec4e321f00
Merge pull request #134072 from yongruilin/master_vg_enable-resourceclaim
Enable Declarative Validation for resource.k8s.io v1/v1beta1/v1beta2
2025-09-17 12:50:14 -07:00
Kubernetes Prow Robot
7bbea380f4
Merge pull request #134085 from jpbetz/patch-9
Add reviewers and approvers to api/testing
2025-09-16 16:26:24 -07:00
yongruilin
380c4c222e feat(validation-gen): Add declarative validation support for ResourceClaim/(v1,v1beta1,v1beta2) 2025-09-16 21:36:18 +00:00
Joe Betz
fb184a9ff4
Update pkg/api/testing/OWNERS
Co-authored-by: Yongrui Lin <yongrlin@google.com>
2025-09-16 16:05:21 -04:00
Lalit Chauhan
f5cd1a1664 Address tests grouping comment 2025-09-16 17:20:17 +00:00
Lalit Chauhan
92dcd02459 Add helpers for declarative validation tests
Introduces new testing helpers to simplify testing of declarative validation rules. The new `VerifyValidationEquivalence` and `VerifyUpdateValidationEquivalence` functions reduce boilerplate by encapsulating the logic for:

- Toggling the `DeclarativeValidation` and `DeclarativeValidationTakeover` feature gates.
- Comparing the validation output from the imperative and declarative paths.

The declarative validation tests for CertificateSigningRequest and ReplicationController are updated to use these new, simpler helpers.
2025-09-16 16:57:21 +00:00
Joe Betz
3799b8bf6a
Add reviewers and approvers to api/testing 2025-09-16 10:25:56 -04:00
Kevin Torres
9f5b09eb7b Unit test pod level hugepage Default and Validation logic 2025-07-24 21:29:04 +00:00
Patrick Ohly
cff91579e8 DRA API: v1 registration + tests 2025-07-24 08:30:25 +02:00
Taahir Ahmed
4624cb9bb9 Pod Certificates: Basic implementation
* Define feature gate
* Define and serve PodCertificateRequest
* Implement Kubelet projected volume source
* kube-controller-manager GCs PodCertificateRequests
* Add agnhost subcommand that implements a toy signer for testing

Change-Id: Id7ed030d449806410a4fa28aab0f2ce4e01d3b10
2025-07-21 21:49:57 +00:00
Cici Huang
a3ecea296c manual change 2025-07-15 01:44:13 +00:00
yongruilin
5d4a85f9f6 Enable versioned validation fuzz testing for certificates v1/v1alpha1/v1beta1 group 2025-07-01 16:13:56 +00:00
yongruilin
a55318fe14 fix: versioned validation test avoid incorrect conversion 2025-06-30 23:11:49 +00:00
Joe Betz
5013938100 Change option to a slice 2025-06-05 18:24:06 -04:00
Joe Betz
9715c90b31 Clarify errors and improve tests 2025-05-23 21:47:09 -04:00
Joe Betz
7dc8660d03 Update testing to fully track subresources 2025-05-23 21:47:08 -04:00
Jordan Liggitt
6bb6c99342
Drop null creationTimestamp from test fixtures 2025-05-02 15:38:40 -04:00
Morten Torkildsen
39507d911f Add resource v1beta2 API 2025-03-26 14:41:09 +00:00
Patrick Ohly
797475e113 DRA: add device taints API
This adds the "DeviceTaint" top-level type to v1alpha3 and related fields to
ResourceSlice and ResourceClaim. It's complete enough bring up an API server
and generate files.
2025-03-18 20:52:54 +01:00