Commit graph

18 commits

Author SHA1 Message Date
Yongrui Lin
a791288d81 test/declarative_validation: migrate DV equivalence tests to new tree
Move the existing declarative_validation_test.go files out of
pkg/registry/ into a top-level tree at
test/declarative_validation/<group>/<kind>/. The new location pairs
each hand-written test with the per-Kind TestMain and version-init
files emitted by validation-gen, so the coverage gate runs alongside
the equivalence checks and apiVersions no longer needs to be
hand-maintained.
2026-05-09 19:11:01 +00:00
Patrick Ohly
163211ee45 apiserver: pass context with ReqInfo to AllowUnconditionalUpdate and AllowCreateOnUpdate
This enables implementing different behavior for AllowUnconditionalUpdate and
AllowCreateOnUpdate depending on the API version, which can be found in
ReqInfo.APIVersion. The specific need for this is to switch from
AllowUnconditionalUpdate=true (not recommended!) to false in v1 of
resource.k8s.io DeviceTaintRule.

This is done by adding the missing context parameter to the existing methods
instead of adding a new optional interface because a) the resulting
implementation is simpler and gets checked by the compiler and b) the Go API
guarantees of k8s.io/apiserver are more relaxed than in other modules because
it's less used downstream.

Example implementation:

    func (*deviceTaintRuleStrategy) AllowUnconditionalUpdate(ctx context.Context) bool {
           reqInfo, _ := request.RequestInfoFrom(ctx)
           if reqInfo != nil && reqInfo.APIVersion == "v1" {
                   // Should have done that already earlier. Better late than never...
                   return false
           }
           // Historic behavior for v1beta2 and older, cannot change that anymore.
           return true
    }
2026-05-05 12:48:19 +02:00
Joe Betz
a0095b5379
Migrate all strategies to DV 2026-04-24 12:01:39 -04:00
Your Name
701db6b6a6 validation-gen: Fix all stable api violations by prefixing +k8s:alpha(since:"1.36") and exclude output_tests from linting 2026-02-25 00:50:31 +00:00
darshansreenivas
ce6ea2f4b0 adding required and other test cases 2025-12-06 11:02:19 -08: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
Patrick Ohly
8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
Arda Güçlü
578ddde80e Add singular name for the rest of types 2022-11-18 12:21:13 +03:00
Paco Xu
db147b7d67 (ut) add tests for bad filed values checking; refactor some funcs 2022-05-09 16:17:32 +08:00
Paco Xu
3fbfd7eb1b add deprecated warning for node beta labels in pv/sc/rc/csi storage capacity
- (pv) deprecated label using warning for node affinity
- (storageclass)  deprecated node labels: allowedTopologies.matchLabelExpressions.key
- (CSIStorageCapacity) deprecated node labels
- (RuntimeClass) deprecated node labels
2022-05-04 15:01:13 +08:00
Paco Xu
acd696266e mark PodOverhead to GA in v1.24; remove in v1.26 2022-03-17 09:30:14 +08:00
Jordan Liggitt
8c8a4cf3e4 Add WarningsOnCreate,WarningsOnUpdate 2021-05-18 10:42:36 -04:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Jordan Liggitt
a1595da534 Attach runtimeclass printer 2019-11-26 13:20:52 -05:00
Ted Yu
87b2a3129b Propagate error from NewREST 2019-08-12 13:55:35 -07:00
Eric Ernst
5e09568c8e pod-overhead: autogenerated code updates
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-06-18 08:05:35 -07:00
Eric Ernst
ec8ef0df20 pod overhead: drop from RuntimeClass base on feature-gate
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-06-18 08:05:35 -07:00
Tim Allclair
63f61a6714 Migrate RuntimeClass to internal API 2019-03-07 11:07:54 -08:00