Commit graph

1187 commits

Author SHA1 Message Date
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
Kubernetes Prow Robot
3e4b5e48f2
Merge pull request #134193 from hoskeri/fix-ipv6allocator
Fix IPv6 allocator for /64 CIDRs
2025-10-08 18:03:01 -07:00
Tim Hockin
8443187688
Warn when quota request > limit 2025-10-03 10:58:35 -07:00
rongfu.leng
79678dd393
feat: add resourcequota WarningsOnCreate request less than limits
Signed-off-by: rongfu.leng <lenronfu@gmail.com>
2025-10-03 10:58:34 -07:00
Tim Allclair
4986abe0b8 Automated refactoring to use SetFeatureGatesDuringTest 2025-10-01 21:10:53 -07:00
Tim Hockin
229c6b13ca Validate ReplicationController.metadata.name
This relies on `+k8s:subfield` and validation cohorts.  The
`k8s:optional` ensures that we don't run the name validation if name is
empty, because core apimachinery will already flag it as Required().

This demonstrates some of the DV value - docs and clients are now (in
theory) able to see what RC's name format is.

Co-Authored-by: Yongrui Lin <yongrlin@outlook.com>
2025-10-01 19:45:37 +00:00
Tim Hockin
7b93851395 Fix ReplicationControl double validation 2025-10-01 18:37:13 +00:00
yongruilin
96349a4608 chore: Move declarative validation featuregates to staging apiserver 2025-09-26 22:30:16 +00:00
yongruilin
2d7dd9164f Refactor: Centralize declarative validation and migration logic
The boilerplate for running declarative validation was duplicated across multiple resource strategies. This included feature gate checks, metric identifier generation, error comparison, and conditional merging logic, which made the code verbose and difficult to maintain.

This commit introduces a new helper function, `rest.ValidateDeclarativelyWithMigrationChecks`, to encapsulate this common logic. All relevant strategies have been refactored to use this new function, resulting in cleaner and more concise code.
2025-09-26 17:22:46 +00:00
Abhijit Hoskeri
22551e56a6 Fix IPv6 allocator for /64 CIDRs
An ipAllocator with a 64 bit IPv6 CIDR can allocate
addresses outside the CIDR range, due to an improper uint64 to int64
cast in the addOffsetAddress function.

Replace the cast with a call to `math/big.Int.SetUint64()`.
2025-09-22 11:07:57 -07: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
Kubernetes Prow Robot
09278c1292
Merge pull request #133946 from lalitc375/k8s-dv-metrics
Add fine grained metrics to narrow down DV mismatches and panics
2025-09-15 19:44:09 -07:00
Lalit Chauhan
1a5e77135b Add fine grained metrics to narrow down DV mismatches and panics 2025-09-16 00:36:14 +00:00
Marek Siarkowicz
1ac067ae0e Fix tests to to only accesses keys from under resourcePrefix 2025-09-10 14:49:58 +02:00
Kubernetes Prow Robot
ef4add4509
Merge pull request #133356 from mayuka-c/issue-133175
Replace usage of deprecated ErrWaitTimeout with recommended method across all Pkgs
2025-09-05 06:43:34 -07:00
Keisuke Ishigami
ddb015f023
Resolve confusing use of TooManyRequests error for eviction (#133097)
modify test "the error includes the reason when the condition.Status is False"
2025-09-04 12:19:14 -07:00
Marek Siarkowicz
683a76dd15 Enforce that all resources set resourcePrefix 2025-09-04 00:11:15 +02:00
Kubernetes Prow Robot
4d15270bd7
Merge pull request #132549 from gavinkflam/130656-fix-duplicate-validations-3
bug: Remove duplicate storage resources update validations
2025-08-27 14:54:12 -07:00
Mayuka Channankaiah
6c56d2fd1b Replace usage of deprecated ErrWaitTimeout with recommended method across all Pkgs 2025-08-01 14:18:06 +05:30
utam0k
60fa65db88
Clear pod.Status.NominatedNodeName when pod is bound
Signed-off-by: utam0k <k0ma@utam0k.jp>
2025-07-29 23:48:11 +09:00
Patrick Ohly
5c4f81743c DRA: use v1 API
As before when adding v1beta2, DRA drivers built using the
k8s.io/dynamic-resource-allocation helper packages remain compatible with all
Kubernetes release >= 1.32. The helper code picks whatever API version is
enabled from v1beta1/v1beta2/v1.

However, the control plane now depends on v1, so a cluster configuration where
only v1beta1 or v1beta2 are enabled without the v1 won't work.
2025-07-24 08:33:45 +02:00
Kubernetes Prow Robot
ade9b7746a
Merge pull request #132595 from AxeZhan/ga3960
Graduate PodLifecycleSleepAction to GA
2025-07-19 13:22:39 -07:00
Tim Allclair
5f829195e6 Only warn when AppArmor annotation doesn't match pod field 2025-07-17 14:46:47 -07:00
Tim Allclair
4fdf09fdc1 Stop syncing AppArmor fields to annotations 2025-07-17 14:07:35 -07:00
Kubernetes Prow Robot
48e04d0d6c
Merge pull request #132871 from dims/bump-k8s.io/kube-openapi-to-latest-SHA-f3f2b991d03b
Bump k8s.io/kube-openapi to latest SHA (f3f2b991d03b) and sigs.k8s.io/structured-merge-diff/{v4 => v6}
2025-07-14 22:32:22 -07:00
Davanum Srinivas
ebc1ccc491
Bump k8s.io/kube-openapi to latest SHA (f3f2b991d03b)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-07-14 07:24:48 -04:00
Daman Arora
fcb595a2df service-ip-alloc: delay ip processing on service recreate
Service storage implements transactions. It creates an IPAddress object first and then creates
the Service object, and if the Service object already exists the complete transaction is
reverted. There can be race conditions when the repair loop picks up the new IPAddress object
for reconciliation before the transaction is reverted. This leads to spurious
IPAddressWrongReference warnings, to suppress these warnings we delay the processing of the new
IPAddress object by 5 seconds. The service allocation creates the IPAddress object before creating
the Service object, we easily identify this scenario when the IPAddress object creation timestamp
is after the Service creation timestamp. We do this only when the IPAddress object is created
recently in order to avoid indefinitely requeue/delay in IPAddress cleanup if for some reason
the service transaction revert fails.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2025-07-14 00:31:53 +05:30
Daman Arora
8de14b526e service-ip-alloc: make repair loop consumer clock interface
The private constructor for the repair loop now consumes clock.Clock interface allowing
predictable unit testing.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2025-07-13 23:51:48 +05:30
Anish Ramasekar
45dfb46448
Add TokenRequestServiceAccountUIDValidation feature gate with UID validation
This change introduces the TokenRequestServiceAccountUIDValidation feature
gate and implements feature-gated service account UID validation for the
TokenRequest API. When enabled, the API validates that the service account
UID in token requests matches the actual service account UID, preventing
token requests for recreated service accounts with the same name but
different UIDs.

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-07-10 23:20:23 -05:00
AxeZhan
dcbed2fbdc Graduate PodLifecycleSleepAction to GA 2025-07-02 09:37:14 +08:00
Gavin Lam
ba46831c87
bug: Remove duplicate storage resources update validations
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2025-06-26 00:29:51 -04:00
Natasha Sarkar
7d85134cae improve unit test coverage for pod observedGeneration 2025-06-25 17:18:07 +00:00
Joe Betz
7dc8660d03 Update testing to fully track subresources 2025-05-23 21:47:08 -04:00
Joe Betz
105391403f Enable scale subresource in generated validations 2025-05-23 21:47:08 -04:00
Joe Betz
a3eddf7d85 Add declarative validation testing for replicationcontroller/scale 2025-05-23 21:47:07 -04:00
Joe Betz
356f395f0d Enable declarative validation for replicationcontroller/scale 2025-05-23 21:47:07 -04:00
Joe Betz
48e1079cf0 Add subresource mapping support to ValidateDeclaratively and introduce configs
# Conflicts:
#	staging/src/k8s.io/apiserver/pkg/registry/rest/validate_test.go
2025-05-23 21:47:07 -04:00
Kubernetes Prow Robot
c96032addd
Merge pull request #131318 from aojea/lock_servicecidr
Lock MultiCIDRServiceAllocator to default and DisableAllocatorDualWrite to GA
2025-05-13 09:51:28 -07:00
Kubernetes Prow Robot
f603a0ada8
Merge pull request #129472 from dims/api-server-crashes-on-concurrent-map-iteration-and-write
Fix API server crash on concurrent map iteration and write
2025-05-08 16:25:13 -07:00
sxllwx
75afa1e0ac
Fix API server crash on concurrent map iteration and write
Improve audit context handling by encapsulating event data and operations behind a structured API. Make
the Audit system more robust in concurrent environments by properly isolating mutable state. The cleaner
API simplifies interaction with audit events, improving maintainability. Encapsulation reduces bugs
by preventing direct manipulation of audit events.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Co-Authored-By: Jordan Liggitt <liggitt@google.com>
Co-Authored-By: sxllwx <scottwangsxll@gmail.com>
2025-05-08 15:31:16 -04:00
Keita Mochizuki
a3097010fa
Change the implementation design of matchLabelKeys in PodTopologySpread to be aligned with PodAffinity (#129874)
* Change the implementation design of matchLabelKeys in PodTopologySpread to be aligned with PodAffinity

* fix1
2025-05-07 13:01:15 -07:00
Antonio Ojea
9bcec340f8 modify unit test for compatibility version
Change-Id: Iacc4066e359d8c7e8fa2d2fab76262cfa50daebb
2025-05-06 13:29:55 +00:00
James Munnelly
8cfb9adbf6 overwrite existing labels during pod Binding storage 2025-03-20 22:39:38 +00:00
James Munnelly
934e247030 Remove kubernetes.io/hostname label copying, skip overriding, and support direct spec.nodeName changes. 2025-03-20 20:19:53 +00:00
James Munnelly
6ddabb6ee6 updating to reflect latest KEP design 2025-03-20 20:19:53 +00:00
James Munnelly
5e7e1e7cf1 KEP-4742: Node Topology Labels via Downward API 2025-03-20 20:19:51 +00:00
kerthcet
1a34095f75 KEP-3094 Promote NodeInclusionPolicyInPodTopologySpread to Stable
Signed-off-by: kerthcet <kerthcet@gmail.com>
2025-03-20 14:54:42 +08:00
Tim Allclair
aba588cd14 Deprecate IPPVSAllocatedStatus: always set allocatedResources with InPlacePodVerticalScaling 2025-03-19 16:00:02 -07:00
Kubernetes Prow Robot
f1c634f93e
Merge pull request #130463 from sanposhiho/ga-mlk
feat: graduate MatchLabelKeysInPodAffinity to GA
2025-03-19 09:06:31 -07:00
Kensei Nakada
10c6a4258f feat: graduate MatchLabelKeysInPodAffinity to GA 2025-03-19 23:06:04 +09:00