Commit Graph

135599 Commits

Author SHA1 Message Date
Aaron Prindle
98c52ccfd7 Update staging/src/k8s.io/code-generator/cmd/validation-gen/validators/mode.go
Co-authored-by: Joe Betz <jpbetz@google.com>
2026-02-13 18:18:35 +00:00
Aaron Prindle
7e5cd910a4 Fix compilation errors from cherry-picks 2026-02-13 18:18:28 +00:00
Aaron Prindle
c04c60f408 Implement declarative modal validation (+k8s:discriminator and +k8s:member)
This introduces state-based validation to declarative validation via the +k8s:discriminator and +k8s:member tags.

Key changes:
- Added validate.Modal runtime function to handle state-based logic, including full ratcheting support (skipping validation on Update if discriminator and value are unchanged).
- Implemented +k8s:discriminator to identify the controlling field (supports string, int, and bool).
- Implemented +k8s:member to map discriminator values to validation rules.
- Added implicit "forbidden-by-default" logic for unhandled modes, with support for pointer, slice, and map types.
2026-02-13 18:16:25 +00:00
Aaron Prindle
d59cfc969d Add MultiWrapperFunction to support bundling multiple validations
This introduces MultiWrapperFunction to the generator AST, allowing multiple validation functions to be bundled into a single emitted closure. It correctly handles short-circuiting logic for the wrapped functions.
2026-02-13 09:15:17 -08:00
Kubernetes Prow Robot
23ea1ec286 Merge pull request #135769 from vshkrabkov/cleanup/unsch-pods-remove-recorder-nil-check
Remove nil checks for unschedulable pods metrics recorder
2026-02-13 18:03:59 +05:30
Kubernetes Prow Robot
5467a9f9e2 Merge pull request #135028 from itzPranshul/master-vg-enable-clusterRole
rbac: migrate PolicyRule.verbs to Declarative Validation
2026-02-13 10:27:59 +05:30
Kubernetes Prow Robot
ec2c7739bc Merge pull request #135808 from tico88612/cleanup/SeparateCacheWatchRPC
SeparateCacheWatchRPC LockToDefault set true
2026-02-13 08:53:59 +05:30
Kubernetes Prow Robot
1132395d4a Merge pull request #136793 from yongruilin/master_vg-strategy-alpha
KEP-5073:  Declarative Validation Lifecycle Update
2026-02-13 07:16:00 +05:30
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
d1b805f41e Mark scheduling Workload validation as Alpha in test 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
3470dbd96e address feedback: add IsAlpha/IsBeta helpers for ValidationStabilityLevel
Introduce IsAlpha() and IsBeta() helper methods on field.Error to
encapsulate stability level checks. Unexport the underlying
ValidationStabilityLevel constants to keep the API surface minimal.
Update the apiserver's validation logic to use these helpers.
2026-02-13 00:54:18 +00:00
yongruilin
4d2a2abdee scheduling/workload: fix tests requiring RequestInfo for declarative validation
- Update resttest and genericregistrytest to support RequestInfo injection.
- Inject RequestInfo in Workload storage and strategy tests to resolve context-related failures.
- Refine validate.go log messages and error deduplication logic.
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
yongruilin
a972411936 opt-in Workload v1alpha1 to explicit declarative enforcement
Mark Workload v1alpha1 validations as +k8s:alpha(since:"1.35") and
configure the registry strategy to use WithDeclarativeEnforcement().
This transitions the resource to the stability-based validation lifecycle,
where enforcement is determined by tag stability and feature gates.
Includes generated code updates.
2026-02-13 00:54:18 +00:00
yongruilin
069f913681 Update mismatch checking to support Validation Lifecycle stages
- Rename takeover to enforced in mismatch checking logic and comments.
- Update recommendation messages to refer to DeclarativeValidationBeta.
- Ensure Alpha-level mismatches always recommend "HV authoritative" (shadowed).
- Filter mismatch candidates by lifecycle stage when explicit enforcement is active.
- Refactor mismatch tests to cover Alpha/Beta scenarios and remove redundancy.
2026-02-13 00:54:18 +00:00
yongruilin
eceed007d3 Implement DeclarativeValidationBeta and Validation Lifecycle strategy
- Introduce WithDeclarativeEnforcement to opt-in to the lifecycle model.
- Update ValidateDeclarativelyWithMigrationChecks to:
    - Enforce Beta-level validations when DeclarativeValidationBeta is enabled.
    - Shadow Alpha-level validations.
    - Filter handwritten errors only for Beta-level validations (when enabled).
    - Limit mismatch checking to Alpha and Beta stages when enforcement is enabled.
- Deprecate WithDeclarativeNative and DeclarativeNative field in field.Error.
- Add comprehensive lifecycle tests and clean up redundant test cases.
2026-02-13 00:54:17 +00:00
yongruilin
0c679cea68 Introduce DeclarativeValidationBeta and deprecate Takeover gate
This change introduces the DeclarativeValidationBeta feature gate in v1.36
as the global safety switch for Beta-stage validation rules and marks
DeclarativeValidationTakeover as deprecated.

Following KEP-5073.
2026-02-13 00:54:11 +00:00
Kubernetes Prow Robot
fb78de873a Merge pull request #136824 from cnuss/issues/136823
client-go: Replace deprecated BackoffManager with DelayFunc in Reflector
2026-02-13 06:10:07 +05:30
Kubernetes Prow Robot
9571e19da9 Merge pull request #134675 from JoelSpeed/enable-kal-optionalorrequired-apiserver-internal
Enforce either optional or required tag on apiserverinternal API group
2026-02-13 06:10:00 +05:30
Kubernetes Prow Robot
b72e248c25 Merge pull request #136953 from lalitc375/revert-dv-native
Revert dv native in the validation-gen framework
2026-02-13 04:44:10 +05:30
Kubernetes Prow Robot
47e2318e85 Merge pull request #136952 from dgrisonnet/kubelet-metrics-provider
Add kubelet_metrics_provider metric
2026-02-13 04:44:00 +05:30
Kubernetes Prow Robot
7f13600dad Merge pull request #136400 from vinayakankugoyal/gitrepo
KEP:5040 Lock gitRepo Volume Driver to disabled.
2026-02-13 03:58:10 +05:30
Kubernetes Prow Robot
03da245585 Merge pull request #134827 from michaelasp/rvStore
Add Resource Version query and Bookmarks to thread safe store
2026-02-13 03:58:00 +05:30
Christian Nuss
33ebd41b2c client-go: Replace deprecated BackoffManager with DelayFunc in Reflector
Move backoff documentation comments to var block for better discoverability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 17:18:14 -05:00
Kubernetes Prow Robot
d7f6f91dae Merge pull request #135820 from pohly/dra-sharing-claim-sequentially-test
DRA: sharing claim sequentially test
2026-02-13 01:50:09 +05:30
Kubernetes Prow Robot
0ba7bf5716 Merge pull request #135503 from aojea/externalname_repairip
repairip externalname to cluster ip type
2026-02-13 01:50:01 +05:30
Joel Speed
82a9a99a44 Restore omitempty on ServerStorageVersion fields 2026-02-12 18:55:47 +00:00
Kubernetes Prow Robot
98dd4d8e60 Merge pull request #136812 from rpb-ant/rpb/sts-not-found
Add 404 handling for the statefulset controller pod deletion codepath
2026-02-13 00:18:00 +05:30
Damien Grisonnet
22706b7bdf pkg/kubelet: add kubelet_metrics_provider metric
This metric is meant to help end-users identify which metrics provider
kubelet is using under the hood to expose container stats.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2026-02-12 19:28:52 +01:00
Kubernetes Prow Robot
b6eb3d0546 Merge pull request #136970 from iPraveenParihar/e2e/snapshot-metadata-typo-fixes
e2e: fix typos in snapshot-metadata testfile
2026-02-12 23:30:02 +05:30
Joel Speed
319978e216 Update openapi/swagger 2026-02-12 17:44:53 +00:00
Joel Speed
551c08e2a2 Update exceptions to drop "it must be optional" 2026-02-12 17:42:44 +00:00
Kubernetes Prow Robot
5b63a8c68e Merge pull request #136921 from dims/dump-from-utils
Move dump package from apimachinery to k8s.io/utils
2026-02-12 22:28:10 +05:30
Kubernetes Prow Robot
728fb46ab1 Merge pull request #136816 from damdo/cloud-provider-add-webhook-tls-options
k8s.io/cloud-provider: Adds missing TLS flags to webhook serving options
2026-02-12 22:28:02 +05:30
Kubernetes Prow Robot
150247a304 Merge pull request #136981 from soltysh/simplify_logs_e2e
Add slight timeout after pods are running, and drop duplicate log lines checks
2026-02-12 20:30:09 +05:30
Kubernetes Prow Robot
096a581c9c Merge pull request #136909 from shwetha-s-poojary/fix_flake_TestWebhookConversion_WhitespaceCABundleEtcdBypass
test: fix the flaking TestWebhookConversion_WhitespaceCABundleEtcdBypass
2026-02-12 20:30:01 +05:30
Ryan Brewster
11c6f8c7c8 Clean up redundant IsNotFound checks in stateful_set_control
🏠 Remote-Dev: homespace
2026-02-12 14:35:10 +00:00
Joel Speed
0b10375aec Add exception for union type in scheduling API
We need to add a marker to allow podgroup to be marked up correctly as a union type, and then teach the nonpointerstructs linter how to understand this
2026-02-12 14:12:36 +00:00
Joel Speed
0ebf47cb08 Update generated code 2026-02-12 14:12:35 +00:00
Joel Speed
a9034c040e Enable nonpointerstructs alongside optionalorrequired 2026-02-12 14:12:33 +00:00
Kubernetes Prow Robot
fef67434a6 Merge pull request #136982 from cpanato/update-go-main
Bump images and versions to go 1.25.7 and distroless iptables
2026-02-12 19:22:04 +05:30
Carlos Panato
634d1f00ab Bump images and versions to go 1.25.7 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2026-02-12 14:04:23 +01:00
Maciej Szulik
c2bf995e96 Add 1s timeout after pods get ready, to ensure log generator produces output
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-02-12 13:36:27 +01:00
Maciej Szulik
6e6107c9e9 Cleans up the test, removing duplicate checks and making code more
readable

Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-02-12 13:35:23 +01:00
Davanum Srinivas
550cc8645b Move dump package from apimachinery to k8s.io/utils
Replace all imports of k8s.io/apimachinery/pkg/util/dump with
k8s.io/utils/dump across the repo. The apimachinery dump package
now contains deprecated wrapper functions that delegate to
k8s.io/utils/dump for backwards compatibility.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-02-12 07:34:19 -05:00
Patrick Ohly
0cb57b97e7 DRA integration: test sharing a claim sequentially
This used to be an E2E test, but it turned out to be too slow and unreliable
and therefore got removed. As an integration test we have a bit better control
over the environment, so it should be possible to avoid the same flakes.

Some of the slowness comes from pods entering backoff. Maybe this is an
opportunity for future improvements.

To support this tests, the ResourceClaim controller is needed. The framework
can start it on demand now, similar to how the scheduler was handled already.
2026-02-12 12:33:22 +01:00
Patrick Ohly
bff684d951 DRA ResourceClaim controller: update logging
This provides a bit more information when the controller touches a
ResourceClaim.
2026-02-12 12:33:22 +01:00
Patrick Ohly
21bf85de15 DRA E2E: support usage without real nodes
This enables usage in test/integration/dra:
- "deploying" a driver merely sets up the usual slices and class
- created pods get force-deleted
2026-02-12 12:33:22 +01:00