Commit graph

841 commits

Author SHA1 Message Date
Jaegoo
2a0a95c811
Migrate secret type immutable (#136886)
* Wire up Secret for declarative validation

* Migrate Secret.Type to declarative immutable validation

* Add +k8s:optional tag to Secret.Type field

* Add TestDeclarativeValidate test for CREATE flow

* Add immutability test cases for unset->set and set->unset

* Fix ValidateDeclarativelyWithMigrationChecks call to include DeclarativeValidationConfig

* Fix double declarative validation by removing manual ValidateDeclarativelyWithMigrationChecks calls

The secret strategy embedded rest.DeclarativeValidation (which implements
DeclarativeValidationStrategy) but also called ValidateDeclarativelyWithMigrationChecks
directly inside Validate and ValidateUpdate. The REST handler and test framework
call ValidateDeclaratively separately after Validate/ValidateUpdate, causing
double execution that broke the AllDeclarativeEnforced test scenario.

Fix by returning only handwritten errors from Validate/ValidateUpdate, matching
the pattern used by csiDriverStrategy and other correctly-migrated strategies.

* Use alpha stability level for +k8s:immutable on Secret.Type

The validation-gen tool enforces that Beta-level tags cannot be used in
Stable validation. Change +k8s:immutable to
+k8s:alpha(since: "1.36")=+k8s:immutable to match other stable-API fields.
Regenerate zz_generated.validations.go and update test expected errors
with .MarkAlpha() accordingly.

* Update alpha stability level version from 1.36 to 1.37

Update +k8s:alpha(since: "1.36") annotations to 1.37 in types.go
and generated.proto for Secret.Type immutability and ReplicationController
declarative validation tags.

* Regenerate zz_generated.validations.go after rebase

Rebase onto latest master brought in validation-gen changes that add
.MarkShortCircuit() to immutable and optional field validations.

* Add generated declarative validation test files for Secret

validation-gen generates test/declarative_validation/core/secret/
as part of Secret declarative validation wiring.

* Add declarative validation coverage test for Secret.type immutability

The coverage checker requires all registered validation rules to be
exercised by tests. Add a test that triggers the immutable validation
error for Secret.type to satisfy coverage for the generated rule:
  v1, Kind=Secret: type FieldValueInvalid origin="immutable"

* Move Secret declarative validation tests to test/declarative_validation

Move all test cases from pkg/registry/core/secret/declarative_validation_test.go
to test/declarative_validation/core/secret/declarative_validation_test.go
per #138872, and remove the original file.

* Revert ReplicationController alpha tags from 1.37 back to 1.36

The since: "1.36" tags on ReplicationController fields track when those
tags were originally added (v1.36) and should not have been changed.
Only the newly added Secret.Type immutable tag targets 1.37.
2026-06-10 05:59:45 +05:30
Lalit Chauhan
0c84f84ec8 Fix wrong marking of errors 2026-06-03 19:33:53 +00:00
Adrian Moisey
cbc8e77b2a
KEP-4427: Remove RelaxedDNSSearchValidation feature gate 2026-05-24 10:21:22 +02:00
Kubernetes Prow Robot
b36864202b
Merge pull request #137755 from HirazawaUi/remove-SidecarContainers-feature-gate
Remove SidecarContainers feature gate
2026-04-23 08:16:45 +05:30
Junya Okabe
d371af5657
Fix ImageVolume validation for empty reference in Pod templates (#135989)
* fix validation

* fix(validation): use ratcheting validation for empty image volume reference
2026-04-23 03:19:30 +05:30
carlory
9a1b8cbe49 Remove feature gate AnyVolumeDataSource
Signed-off-by: carlory <baofa.fan@daocloud.io>
2026-03-23 16:38:07 +08:00
HirazawaUi
964d79dd6e Remove SidecarContainers feature gate 2026-03-19 15:56:47 +08:00
Kubernetes Prow Robot
a439183755
Merge pull request #137352 from natasha41575/nonsidecarinitctrs
[InPlacePodVerticalScaling] Relax validation to support in-place resizing non-sidecar initContainers
2026-03-19 08:44:28 +05:30
Natasha Sarkar
fa50e63b81 relax validation check for resizing nonsidecar init containers 2026-03-19 00:43:52 +00:00
Praveen Krishna
6b83eef7a2 Add pod Status and ResourceSlice API validation 2026-03-18 19:20:10 +00:00
Praveen Krishna
2ce83e6cbb Add validation to disable in-place resize for pods with node-allocatable resource claims 2026-03-18 19:20:10 +00:00
Benjamin Elder
f6d42d302b make VolumeMountStatus.VolumeStatus a pointer to preserve serialization compatibility 2026-03-17 17:37:23 -07:00
Kubernetes Prow Robot
5f94c5bb7d
Merge pull request #137458 from natasha41575/tighten-initctr-validation
[InPlacePodVerticalScaling] validate initContainer restart policy against container resize policy
2026-03-18 00:47:39 +05:30
Natasha Sarkar
926e9fc8b2 validate container restart policy against container resize policy 2026-03-17 18:22:43 +00:00
Kubernetes Prow Robot
7ccd95e229
Merge pull request #137369 from kfess/bugfix/error-message
Fix incorrect error message in container restart policy validation
2026-03-17 19:05:42 +05:30
Kubernetes Prow Robot
4730b179bd
Merge pull request #137321 from nojnhuh/resourceclaimname-status-validation
Fix path in Pod status resourceClaimName validation
2026-03-13 02:57:35 +05:30
Yuan Wang
99f9875dd2 Add unit test for immutable restart policy rules 2026-03-10 20:46:09 +00:00
Antoni Zawodny
3f094dc228
Create Workload API v1alpha2 (#136976)
* Drop WorkloadRef field and introduce SchedulingGroup field in Pod API

* Introduce v1alpha2 Workload and PodGroup APIs, drop v1alpha1 Workload API

Co-authored-by: yongruilin <yongrlin@outlook.com>

* Run hack/update-codegen.sh

* Adjust kube-scheduler code and integration tests to v1alpha2 API

* Drop v1alpha1 scheduling API group and run make update

---------

Co-authored-by: yongruilin <yongrlin@outlook.com>
2026-03-10 07:59:10 +05:30
kita456
532cc47d71 Fix incorrect error message in container restart policy validation 2026-03-03 22:17:56 +09:00
Carlos Eduardo Arango Gutierrez
ad6c155449 KEP-4680: Add message field support to DRA device health reporting
Author: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Co-Authored-By: Harshal Patil <12152047+harche@users.noreply.github.com>

Signed-off-by: Harshal Patil <12152047+harche@users.noreply.github.com>
2026-03-02 11:58:43 -05:00
Jon Huhn
b0ec568249 Fix path in Pod status resourceClaimName validation 2026-02-28 17:50:35 -06:00
kita456
30ce233ff0 fix container restart rule error message 2026-02-24 19:33:21 +09:00
Darshan Murthy
b4947a5891
feat(storage): enable validation-gen + DV wiring for storage.k8s.io (#135438)
* Enable DV coverage for VolumeAttachmentSpec.Attacher validation

update code-gen

* addressing PR comments
2026-01-24 14:29:26 +05:30
carlory
f8e8e55f1d
locked the feature-gate VolumeAttributesClass to default (true) and switch storage version from v1beta1 to v1
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-12-18 15:59:33 +08:00
Itamar Holder
2c15d3b8e1 Add field wiping and validation logic
Signed-off-by: Itamar Holder <iholder@redhat.com>
2025-11-18 14:14:41 +02:00
ndixita
edc3b77cf8
Kubelet changes and unit tests
Signed-off-by: ndixita <ndixita@google.com>
2025-11-11 18:19:07 +00:00
ndixita
84776abaff
Modifying validation logic and pod strategy for PodResize to accommodate for Pod Level Resources resize 2025-11-11 18:15:22 +00:00
Kubernetes Prow Robot
462ee14a36
Merge pull request #134345 from yuanwang04/restart-pod
Implement RestartAllContainers
2025-11-11 07:18:56 -08:00
Heba
aceb89debc
KEP-5471: Extend tolerations operators (#134665)
* Add numeric operations to tolerations

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* code review feedback

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* add default feature gate

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add integration tests

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add toleration value validation

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add validate options for new operators

Signed-off-by: helayoty <heelayot@microsoft.com>

* Remove log

Signed-off-by: helayoty <heelayot@microsoft.com>

* Update feature gate check

Signed-off-by: helayoty <heelayot@microsoft.com>

* emove IsValidNumericString func

Signed-off-by: helayoty <heelayot@microsoft.com>

* Implement IsDecimalInteger

Signed-off-by: helayoty <heelayot@microsoft.com>

* code review feedback

Signed-off-by: helayoty <heelayot@microsoft.com>

* Add logs to v1/toleration

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
Signed-off-by: helayoty <heelayot@microsoft.com>

* Update integration tests and address code review feedback

Signed-off-by: helayoty <heelayot@microsoft.com>

* Add feature gate to the scheduler framework

Signed-off-by: helayoty <heelayot@microsoft.com>

* Remove extra test

Signed-off-by: helayoty <heelayot@microsoft.com>

* Fix integration test

Signed-off-by: helayoty <heelayot@microsoft.com>

* pass feature gate via TolerationsTolerateTaint

Signed-off-by: helayoty <heelayot@microsoft.com>

---------

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
Signed-off-by: helayoty <heelayot@microsoft.com>
2025-11-10 12:42:54 -08:00
Yuan Wang
aac951d902 Add dependency for NodeDeclaredFeatures 2025-11-10 09:41:02 +00:00
Yuan Wang
97c3f575b9 Refactor validation 2025-11-10 09:41:02 +00:00
Yuan Wang
2eb1eeeabf add disruptive tests 2025-11-10 09:41:02 +00:00
Yuan Wang
83c5cd5526 Implement restartPod action 2025-11-10 09:41:02 +00:00
Kubernetes Prow Robot
171d2dacd2
Merge pull request #134893 from HirazawaUi/kep-5607
KEP-5607: Allow hostNetwork pods to use user namespace
2025-11-06 12:43:15 -08:00
HirazawaUi
e986000e6a KEP-5607: Allow hostNetwork pods to use user namespaces 2025-11-06 22:45:36 +08:00
Maciej Skoczeń
9677ac4c0b api: Add WorkloadReference to Pod spec 2025-11-06 09:36:42 +00:00
Kubernetes Prow Robot
326ce8b16d
Merge pull request #134339 from huww98/mutable-pv-affinity
KEP-5381: mutable pv nodeAffinity
2025-11-06 01:33:11 -08:00
Kubernetes Prow Robot
b869afe68d
Merge pull request #133389 from pravk03/node-capabilities
Introduce node declared features framework
2025-11-06 01:32:54 -08:00
胡玮文
3882f0cf17 allow PV.Spec.NodeAffinity update 2025-11-06 14:31:56 +08:00
Praveen Krishna
c30b75b008 feat: Implement node declared features reporting and validation.
* Reports node declared features in Node.Status.DeclaredFeatures.
* Add kubelet admission handler to check pod required features and match with node declared features on pod creation.
* Checks node declared features on pod updates and emits events if the node does not
  satisfy the pod's feature requirements.
* Adds API validation for node object.
2025-11-06 00:51:39 +00:00
yliao
6676982316 fixed non-sidecar init container device requests and mappings 2025-11-05 22:48:50 +00:00
Kubernetes Prow Robot
459bea5adf
Merge pull request #135084 from tallclair/resize-validation
Fix pod resize validation when adding non-resizable resources
2025-11-04 14:32:04 -08:00
Tim Allclair
9b95eaf593 Fix pod resize validation when adding non-resizable resources 2025-11-03 20:39:37 -08:00
tinatingyu
59e075e8d3 Promote PodCertificateRequests to v1beta1 2025-11-02 05:33:44 +00:00
Dan Winship
715228f478 Remove LoadBalancerIPMode feature gate 2025-10-24 09:12:03 -04:00
Dan Winship
b5297b18ab Remove AllowServiceLBStatusOnNonLB feature gate 2025-10-24 09:12:01 -04:00
Dan Winship
02926c9563 Update PreferSameTrafficDistribution to GA 2025-10-14 08:20:43 -04: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
Tim Allclair
4986abe0b8 Automated refactoring to use SetFeatureGatesDuringTest 2025-10-01 21:10:53 -07:00
yongruilin
51f02aa58a fix: Update error origin in ValidateDNS1123Label to use k8s-short-name format 2025-10-01 21:10:07 +00:00