Commit graph

442 commits

Author SHA1 Message Date
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
Joe Betz
ed08387663 Enable versioned validation fuzz testing for core v1 group 2025-03-12 19:53:47 -04:00
Tim Hockin
1d365762a5 Introduce versioned validation test utilitizes and add fuzz tester
This makes a bold assumption: that the errors (count and basic content)
will be the same across versions.  If this turns out to be untrue, this
may need to get more sophisticated.  It should fail obviously when we
hit that edge.
2025-03-11 20:37:21 -04:00
Tim Hockin
e54719bb66
Use randfill, do API renames 2025-03-08 15:18:00 -08:00
Patrick Ohly
2e64c72249 DRA API: register v1beta1
This is the minimal set of changes that are needed to make the new version
usable. The storage version is still v1alpha3. More changes will follow.
2024-11-06 13:03:18 +01:00
Joe Betz
3a1733f302 Add MutatingAdmissionPolicy API
This is closely aligned with ValidatingAdmissionPolicy
except that instead of validations that can fail with
messages, there are mutations, which can be defined
either with as an ApplyConfiguration or JSONPatch.

Co-authored-by: cici37 <cicih@google.com>
2024-11-04 21:40:38 -05:00
Luis Sanchez
aaa7364f60 cover additional types in unstructured roundtrip test
Co-authored-by: Ben Luddy <bluddy@redhat.com>
2024-10-11 16:07:39 -04:00
Patrick Ohly
91d7882e86 DRA: new API for 1.31
This is a complete revamp of the original API. Some of the key
differences:
- refocused on structured parameters and allocating devices
- support for constraints across devices
- support for allocating "all" or a fixed amount
  of similar devices in a single request
- no class for ResourceClaims, instead individual
  device requests are associated with a mandatory
  DeviceClass

For the sake of simplicity, optional basic types (ints, strings) where the null
value is the default are represented as values in the API types. This makes Go
code simpler because it doesn't have to check for nil (consumers) and values
can be set directly (producers). The effect is that in protobuf, these fields
always get encoded because `opt` only has an effect for pointers.

The roundtrip test data for v1.29.0 and v1.30.0 changes because of the new
"request" field. This is considered acceptable because the entire `claims`
field in the pod spec is still alpha.

The implementation is complete enough to bring up the apiserver.
Adapting other components follows.
2024-07-22 18:09:34 +02:00
Patrick Ohly
62d21589ef api test: update TestDefaulting
Logging and sub-tests were added to help debug this problem:
the test passes for ResourceClaim (same defaulting!) and fails
for the list, but only if run together with the other test cases?!

    $ go test ./pkg/api/testing
    --- FAIL: TestDefaulting (1.76s)
        --- FAIL: TestDefaulting/resource.k8s.io/v1alpha3,_Kind=ResourceClaimList (0.01s)
            defaulting_test.go:238: expected resource.k8s.io/v1alpha3, Kind=ResourceClaimList to trigger defaulting due to fuzzing
    FAIL
    FAIL	k8s.io/kubernetes/pkg/api/testing	17.294s
    FAIL
    $ go test -run=TestDefaulting/resource.k8s.io/v1alpha3,_Kind=ResourceClaimList ./pkg/api/testing
    ok  	k8s.io/kubernetes/pkg/api/testing	0.062s

What fixed that problem was increasing the likelihood of generating the right
test object by iterating more often before giving up.
2024-07-21 17:28:14 +02:00