Commit graph

7300 commits

Author SHA1 Message Date
Kubernetes Prow Robot
ad8c9819a2
Merge pull request #139061 from omerap12/refactor-replica-calc-test
HPA: refactor replica_calculator_test: consolidate metric case tests
2026-05-20 20:31:54 +05:30
Kubernetes Prow Robot
1bb07fcb35
Merge pull request #138736 from rahulbabu95/fix/endpoint-controller-ipfamilies-guard
fix: avoid panic on services with empty IPFamilies
2026-05-20 17:13:45 +05:30
Kubernetes Prow Robot
ae2febc8b5
Merge pull request #138995 from soltysh/speedup_sts_tests
Speed up StatefulSet unit tests
2026-05-19 15:33:08 +05:30
Maciej Szulik
7213a2099b
Move various one-time testFn inline
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-05-19 10:56:35 +02:00
Maciej Szulik
5cf02ebbcc
Use fakeclock in all tests
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-05-19 10:39:17 +02:00
Maciej Szulik
4993d95630
Speed up StatefulSet unit tests
TestStatefulSetScaleDownRespectsMinReadySeconds and
TestStatefulSetOnDeleteStrategyIgnoresMinReadySeconds are testing
.spec.minReadySeconds. This resulted in tests spinning sufficiently long
to reach the desired value. In both cases it was set to 30s.
This change modifies scaleUpStatefulSetControl allowing to inject
fakeClock which allows faster time changes, thus speeding the tests.

Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-05-19 10:15:30 +02:00
Mike Fedosin
86f94fda0c
Fix error formatting and use proper error wrapping in HPA controller (#139029)
* Fix format-string argument order in object metric error messages

The error format strings in GetObjectMetricReplicas and
GetObjectPerPodMetricReplicas had the arguments in the wrong order,
causing objectRef.Kind to be printed where the error should appear
and vice versa.

Signed-off-by: Mikhail Fedosin <mfedosin@redhat.com>

* Use %w for error wrapping in fmt.Errorf calls in podautoscaler

Replace %v with %w for error arguments in fmt.Errorf throughout the
HPA controller, replica calculator, and metrics client. This enables
proper error wrapping so that callers can use errors.Is and errors.As
to inspect underlying errors.

Signed-off-by: Mikhail Fedosin <mfedosin@redhat.com>

---------

Signed-off-by: Mikhail Fedosin <mfedosin@redhat.com>
2026-05-18 20:47:54 +05:30
Kubernetes Prow Robot
a4aee62c39
Merge pull request #139025 from omerap12/hpaConsistency
Add the ability for the hpa controller to read its own writes
2026-05-18 19:56:02 +05:30
Kubernetes Prow Robot
1619326c6a
Merge pull request #138981 from gnufied/implement-optimized-selinux-metric-emission
Improve performance characteristic of selinux metric emission
2026-05-18 16:53:51 +05:30
Kubernetes Prow Robot
96c348e943
Merge pull request #138837 from mattcary/multi-msg
Clarify multi-attach events
2026-05-18 15:47:59 +05:30
Hemant Kumar
f02ddd0e3b Only emit non-dupicated values as metrics 2026-05-15 11:40:56 -04:00
Kubernetes Prow Robot
016a2bcfa4
Merge pull request #138481 from carlory/fix-broken-graceful-leader-transition
controller/resourcepoolstatusrequest: Improve goroutine mgmt
2026-05-15 20:22:30 +05:30
Hemant Kumar
dfc9d96007 Optimize how deletions are handled 2026-05-15 00:05:01 -04:00
Omer Aplatony
09b3daa521 refactor replica_calculator_test: consolidate metric case tests
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
2026-05-14 15:24:56 +00:00
Kubernetes Prow Robot
f39965b62c
Merge pull request #138858 from omerap12/refactor-TestReplicasCalcResourceScale
HPA: refactor replica_calculator_test GetResourceReplicas
2026-05-14 14:36:28 +05:30
Omer Aplatony
9b2b31c3c5 Add the ability for the hpa controller to read its own writes
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
2026-05-14 08:34:39 +00:00
Omer Aplatony
41d10bc9e0 refactor replica_calculator_test GetResourceReplicas
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
2026-05-14 08:11:10 +00:00
Jordan Liggitt
bed4a34ad8
Drop meaningless ,inline from json tags 2026-05-13 11:24:04 -04:00
Kubernetes Prow Robot
553312e6c2
Merge pull request #138657 from jpbetz/codegen-discovery
Enable validation-gen for all existing and future APIs
2026-05-13 01:16:37 +05:30
Joe Betz
9d65aeabb6
Explicitly disable validation-gen where not needed 2026-05-12 12:49:01 -04:00
Hemant Kumar
9047f71b70 Improve performance characteristic of selinux metric emission 2026-05-11 21:51:40 -04:00
Joe Betz
119a1460c1
Generate deepcopy 2026-05-11 12:27:56 -04:00
Patrick Ohly
4a305f8fc7 DRA: fix component list for ResourceClaim metric
The endpoint-mappings.yaml file specifies which components use which
metrics. The case some, but not all core components (kube-controller-manager
and kube-scheduler in this case) sharing the same metrics was not
supported. This gets fixed by not returning early once the first file path
matches.

Not all metrics in pkg/controller/resourceclaim/metrics are shared. To make the
sharing clearer and fit into the file-path based component support in
endpoint-mappings.yaml, the shared metric gets moved to a new
pkg/resourceclaim/metrics package.
2026-05-11 12:31:45 +02:00
Patrick Ohly
341b7d65b6 DRA: harmonize ResourceClaim creation metric
Both kube-controller-manager and kube-scheduler create ResourceClaims. Using
the same metric (sub-system: "dynamic_resource_allocation", name:
"resourceclaim_creates_total") in both components simplifies aggregation across
the entire cluster.
2026-05-11 12:15:14 +02:00
Kubernetes Prow Robot
63b36867dd
Merge pull request #138016 from pacoxu/fix-ut-pod-group
fix PodGroup protection test flake by waiting for pod watch before delete
2026-05-11 07:01:46 +05:30
Davanum Srinivas
cacb333aad
Update pkg/controller/scheduling/podgroupprotection/podgroup_protection_controller_test.go
Co-authored-by: Ania Borowiec <anias@google.com>
2026-05-10 20:38:25 -04:00
Kubernetes Prow Robot
692d9f21dd
Merge pull request #138907 from Jefftree/remove-locked-apimachinery-feature-gates
Remove locked GA feature gates (sig-api-machinery)
2026-05-09 01:57:18 +05:30
Jefftree
dfa449fabf Remove locked GA feature gate OrderedNamespaceDeletion 2026-05-08 14:15:45 -04:00
Kubernetes Prow Robot
d9fb718434
Merge pull request #138874 from michaelasp/svmPatch
Switch to regular merge patch for SVM
2026-05-08 09:21:16 +05:30
Michael Aspinwall
7847ab6b00 Switch to regular merge patch for SVM 2026-05-08 00:31:26 +00:00
Kubernetes Prow Robot
af6d86c7cc
Merge pull request #138759 from soltysh/drop_job_features
Drop job features
2026-05-07 20:09:26 +05:30
Kubernetes Prow Robot
a11a1367fb
Merge pull request #138294 from Fedosin/hpa-immediate-enqueue
hpa: eliminate reconciliation delay on HPA creation and spec changes
2026-05-07 16:35:18 +05:30
Maciej Szulik
c35fd21a6b
Drop JobPodReplacementPolicy after the feature GA-ed in 1.34
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-05-07 12:05:44 +02:00
Matthew Cary
f2a52b6eef Clarify multi-attach events
Change-Id: Id5e68c515d3b4d7c55be72da081604aad8705c76
2026-05-06 21:47:14 +00:00
Kubernetes Prow Robot
0e157a4b2c
Merge pull request #138368 from MyoungHaSong/fix-storageversionmigrator-test-goroutine-leak
Fix goroutine leak in storageversionmigrator migrationrunner test
2026-05-06 00:36:23 +05:30
Kubernetes Prow Robot
036205cc2e
Merge pull request #138711 from soltysh/drop_LogarithmicScaleDown
Drop LogarithmicScaleDown after the feature GA-ed in 1.31
2026-05-05 23:34:29 +05:30
Kubernetes Prow Robot
74f4ad5e38
Merge pull request #138698 from michaelasp/circuitBreaker
Ensure leases are not stale in node controller before marking unhealthy
2026-05-05 23:34:21 +05:30
Zhijun Liao
5d27870207
StatefulSet: Fix OnDelete strategy not updating CurrentRevision (#136833)
* Fix StatefulSet OnDelete strategy not updating CurrentRevision

Signed-off-by: Zhijun <dszhijun@gmail.com>

* Fix linter issue

Signed-off-by: Zhijun <dszhijun@gmail.com>

---------

Signed-off-by: Zhijun <dszhijun@gmail.com>
2026-05-05 21:12:24 +05:30
Maciej Szulik
57a80ebae8
Drop JobSuccessPolicy after the feature GA-ed in 1.33
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-05-05 11:09:40 +02:00
Maciej Szulik
432a3477cc
Drop JobBackoffLimitPerIndex after the feature GA-ed in 1.33
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-05-05 11:09:35 +02:00
Michael Aspinwall
9991d72c6b Add circuit breaker approach to ensure leases are not stale in node controller 2026-05-04 22:14:10 +00:00
Maciej Szulik
3a8fa19cae
Drop LogarithmicScaleDown after the feature GA-ed in 1.31
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-05-04 16:27:43 +02:00
Rahul
53361ff47e
fix(endpoint): avoid panic on services with empty IPFamilies
Accessing svc.Spec.IPFamilies[0] without a bounds check panics when a
service reaches the controller with an empty IPFamilies field. This can
happen via watch events: the apiserver's defaultOnRead decorator populates
IPFamilies on GET/LIST but not on watch (cachingObject wrapping bypasses
the type assertion).

Restore the inference logic removed in #130101: fall back to ClusterIP
for headful services and pod IP for headless services.

Signed-off-by: Rahul <rahulbabu95@gmail.com>
2026-05-01 13:39:13 -07:00
Kubernetes Prow Robot
85a9fce0f9
Merge pull request #138680 from soltysh/cleanup_statefulset
Cleanup statefulset helpers and tests
2026-04-30 15:35:24 +05:30
Maciej Szulik
12c48e2158
Squash similar statefulset updates tests under a single table driven test
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-04-30 11:06:00 +02:00
Maciej Szulik
de7588393c
Squash similar pod delete tests under a single table driven test
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-04-29 11:57:38 +02:00
Maciej Szulik
724b3372df
Cleanup statefulset controller helpers
- squash isFailed and isSucceeeded under single isTerminalPhase
- remove dropParentName in favor of getParentNameAndOrdinal

Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-04-29 11:54:28 +02:00
zak905
04286814e7 clean up: remove loop variable capture 2026-04-28 23:53:27 +02:00
Mikhail Fedosin
10742ec428 hpa: eliminate reconciliation delay on HPA creation and spec changes
Previously, creating or updating an HPA always went through
AddRateLimited, delaying reconciliation by the full resync period
(default 15s). This causes a noticeable lag between applying an HPA
and seeing it take effect, and grows worse with longer resync
intervals (e.g. 60s).

Switch enqueueHPA from queue.AddRateLimited to queue.Add so that
newly created HPAs are processed immediately. In updateHPA, compare
the Generation field (gated behind the HPAGeneration feature) to
distinguish spec changes from status-only updates: spec changes
trigger immediate reconciliation via queue.Add, while status-only
changes remain rate-limited to avoid the hot-loop from
kubernetes#42715 where the controller's own status writes would
re-trigger continuous reconciliation. When HPAGeneration is disabled,
all updates fall back to rate-limited enqueue (the original behavior).

Type-assertion fallbacks in updateHPA (e.g. DeletedFinalStateUnknown)
now also use rate-limited enqueue to prevent any theoretical hot-loop.

The periodic resync cadence is unaffected: processNextWorkItem
continues to call AddRateLimited after every reconciliation cycle.
2026-04-27 10:15:58 +02:00
Patrick Ohly
67800794aa ktesting: create client-go/ktesting
The client-go variant of ktesting is a superset of the normal
ktesting, which makes it possible to get the full original
functionality simply by changing the import path.
2026-04-24 21:54:19 +02:00