579 Commits
Author SHA1 Message Date
weizhoublue 4e42fc8f88 Deployment rollouts fail to report timeouts after old ReplicaSet scale-down errors (#142902)
* Deployment rollouts fail to report timeouts after old ReplicaSet scale-down errors

Signed-off-by: weizhou blue <weizhou.lan@daocloud.io>

* Consolidate deployment rollout status and error handling

Signed-off-by: weizhou blue <weizhou.lan@daocloud.io>

---------

Signed-off-by: weizhou blue <weizhou.lan@daocloud.io>
2026-10-15 14:26:12 +00:00
Guy Yankovitch 9582547bfc Deployment: surface old RS scale-down errors for workqueue retry (#142650)
* Deployment: surface old RS scale-down errors for workqueue retry

reconcileOldReplicaSets was returning nil when cleanupUnhealthyReplicas
or scaleDownOldReplicaSetsForRollingUpdate failed, so sync looked
successful and did not AddRateLimited. Propagate the error like the
new-RS path, and add a unit test that injects an RS update failure.

* Deployment: fold old-RS scale error cases into table tests

Address review: inject RS update failures in reconcileOldReplicaSets
table (ready and unavailable old replicas) and assert with errors.Is.
2026-10-09 20:31:33 +00:00
kubernetes-prow[bot] 64124ea6ca Merge pull request #140828 from skitt/drop-k8s-utils-integer
Drop k8s.io/utils/integer
2026-09-25 17:16:29 +00:00
Patrick Ohly 2579861734 kube-controller-manager: use context-aware client-go
Kubernetes 1.37 finished the introduction of context-aware client-go APIs.
Components like kube-controller-manager which are meant to support contextual
logging should use those new APIs.

This is not enforced yet because existing code must be updated first. Once
that is done, enforcement of everything touched here can be enabled tree-wide.
2026-09-07 16:49:09 +02:00
Stephen Kitt e5dd45fd11 Drop k8s.io/utils/integer
The package is entirely deprecated, has a single user in k/k, with a
trivial replacement. This drops it and prevents its re-introduction.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-07-22 09:59:24 +02:00
Joe Betz e89ecc6af0 generate 2026-06-30 18:02:28 -04:00
Joe Betz 119a1460c1 Generate deepcopy 2026-05-11 12:27:56 -04:00
Kubernetes Prow Robot 74b206cc04 Merge pull request #138345 from soltysh/deployment_cleanup
Deployment controller cleanups
2026-04-23 06:08:19 +05:30
Jeffrey Ying e5033d1fde Simplify deployment controller deletePod logic, drop network call (#136639)
* Simplify deployment controller deletePod logic and avoid extra network call

* Fix tests
2026-04-23 03:20:01 +05:30
Maciej Szulik 83496be2cc Drop outdated TODOs
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-04-13 16:08:32 +02:00
Maciej Szulik 1fa236c8f7 Drop extensions/v1beta1 from deployment controller
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-04-13 16:08:13 +02:00
Maciej Szulik 46eed6f82c Move reading podMap to where it's actually needed
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-04-13 16:08:09 +02:00
Jordan Liggitt 45900a1deb Fix vet error 2026-03-05 18:11:02 -05:00
Maciej Szulik 5f21c6c709 Eliminate duplicate scale methods deployment controller in favor of a parameter
This initially was attempted in 5f083e3b9f
but it caused e2e failing heavily (see
https://github.com/kubernetes/kubernetes/issues/135222 for more details).
The changes proposed in e6641cd290
clarified the naming of the two existing scale methods but they still
leave both of them as is.

This change goes a step further by combining both into a single method
with a parameter `forceUpdate` which is responsible for driving the mode
of execution between lazy update and a forced update.

Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-01-15 13:50:39 +01:00
Jefftree 5e753a131d Update benchmark for deployment 2026-01-08 15:10:32 +00:00
Jefftree 1250c7d56e Add pod indexer to deployment controller 2026-01-08 13:55:48 +00:00
Kubernetes Prow Robot c9994c5f82 Merge pull request #135234 from atiratree/renameScaleReplicaSetAndRecordEvent
rename scaleReplicaSetAndRecordEvent to scaleReplicaSetWithLazyAnnotationUpdate
2026-01-08 18:39:40 +05:30
Filip Křepinský e6641cd290 rename scaleReplicaSetAndRecordEvent to scaleReplicaSetWithLazyAnnotationUpdate 2025-11-08 10:18:50 -05:00
Maciej Szulik 499bff4ca4 Revert "controller: duplicate utility method cleanup" 2025-11-05 21:06:09 +01:00
Kubernetes Prow Robot 9ef1a14d68 Merge pull request #134840 from ahmetb/ahmet/mini-cleanup
controller: duplicate utility method cleanup
2025-11-05 08:06:58 -08:00
Ondra Kupka 6e0a4da2f6 controller/deployment: Improve goroutine mgmt
Make sure all threads are terminated when Run returns.
2025-10-29 19:00:31 +01:00
Ahmet Alp Balkan 5f083e3b9f controller: duplicate utility method cleanup
It appears one of these methods in deployment controller is redundant now that
we always emit Events during scaling.
2025-10-23 22:04:21 -07:00
Stephen Kitt 1e2817d589 Avoid no-change lambdas
This replaces functions that wrap another function with no change with
a direct reference to the wrapped function.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2025-10-23 09:46:15 +02:00
Aditi Gupta 7d14367f57 Change WaitForNamedCacheSync to WaitForNamedCacheSyncWithContext.
This is part of the ongoing effort to adopt contextual logging
and utilities throughout the codebase.

Contributes to  #126379

Signed-off-by: Aditi Gupta <aditigpta@google.com>
2025-09-05 18:49:31 +00:00
Huy Pham b2f27c0649 fix: Truncate too long Deployment name in RS name (#132560)
* fix: Truncate too long Deployment name in RS name

* fix: lint & adjust unit tests

* fix: use const for "-" & unit tests

* Add test case for very long hash

* Explicitly define expected deployment name portion
2025-06-27 16:32:29 -07:00
Jordan Liggitt 6bb6c99342 Drop null creationTimestamp from test fixtures 2025-05-02 15:38:40 -04:00
Filip Křepinský 8db1426554 rename DeploymentPodReplacementPolicy FG to DeploymentReplicaSetTerminatingReplicas 2025-03-27 20:27:44 +01:00
Filip Křepinský e263b878ee Deployment controller should count terminating pods in the status 2025-01-23 22:37:05 +01: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
Filip Křepinský 05bc270870 add tests for getReplicaSetFraction in the deployment controller (#128535)
* better name variables in deployment_util

* add tests for getReplicaSetFraction in the deployment controller

- make validation more robust and make sure we do not divide by 0
2024-11-04 19:11:43 +00:00
Kubernetes Prow Robot cc319bf654 Merge pull request #128527 from atiratree/annotations-validation
improve validation for ReplicaSet annotations in the deployment controller
2024-11-04 13:07:28 +00:00
Filip Křepinský 3ac0ac7a81 improve validation for ReplicaSet annotations in the deployment controller 2024-11-04 10:43:16 +01:00
Filip Křepinský a460e2c413 simplify ScalingReplicaSet event building in the deployment controller 2024-11-04 08:42:22 +01:00
Kubernetes Prow Robot a1df68a31f Merge pull request #125118 from jsoref/from-to
Order ScalingReplicaSet message from->to
2024-10-09 08:36:22 +01:00
Josh Soref 502c05ed01 chore: Order ScalingReplicaSet message from->to
* change format of event
* include `from 0` for new replicas
* update describe tests to reflect current output

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2024-10-08 09:59:29 -04:00
Joe Betz 2595aa1309 generate 2024-09-03 14:26:26 -04:00
Alvaro Aleman 6d0ac8c561 Use the generic/typed workqueue throughout
This change makes us use the generic workqueue throughout the project in
order to improve type safety and readability of the code.
2024-05-04 14:33:12 -04:00
Mengjiao Liu b584b87a94 kube-controller-manager: readjust log verbosity
- Increase the global level for broadcaster's logging to 3 so that users can ignore event messages by lowering the logging level. It reduces information noise.
- Making sure the context is properly injected into the broadcaster, this will allow the -v flag value to be used also in that broadcaster, rather than the above global value.
- test: use cancellation from ktesting
- golangci-hints: checked error return value
2024-02-26 14:51:56 +08:00
weilaaa eb8f3f194f use build-in max and min func to instead of k8s.io/utils/integer funcs 2023-12-15 15:09:11 +08:00
Stephen Kitt aa89e6dc97 Use ptr.To to retrieve intstr addresses
This uses the generic ptr.To in k8s.io/utils to replace functions and
code constructs which only serve to return pointers to intstr
values. Other uses of the deprecated pointer package are updated in
modified files.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-09-08 11:10:50 +02:00
DrAuYueng a4ce32769f fix pod delete log in deployment controller
Signed-off-by: DrAuYueng <ouyang1204@gmail.com>
2023-08-25 22:20:51 +08:00
git-jxj a5b3a4b738 cleanup: Update deprecated FromInt to FromInt32 (#119858)
* redo commit

* apply suggestions from liggitt

* update Parse function based on suggestions
2023-08-16 09:33:01 -07:00
Ziqi Zhao dfc1838379 Migrated pkg/controller/volume|util|replicaset|nodeipam to contextual logging
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
2023-07-06 07:39:52 +08:00
Stephen Kitt 5bfe738af2 apps: replace intstr.FromInt with intstr.FromInt32
This touches cases where FromInt() is used on numeric constants, or
values which are already int32s, or int variables which are defined
close by and can be changed to int32s with little impact.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-05-01 09:17:05 +02:00
ZhangKe10140699 66bda6c092 deployment controller: use contextual logging 2023-03-13 19:00:44 +08:00
Jordan Liggitt 78cb3862f1 Fix indentation/spacing in comments to render correctly in godoc 2022-12-17 23:27:38 -05:00
ZhangYu d61849e800 pkg/controller/deployment/util/deployment_util.go:Improving test coverage 2022-11-22 10:12:58 +08:00
Kubernetes Prow Robot 28ced69b76 Merge pull request #113054 from logicalhan/proxy-metric
remove rate limiter metric as it is not in use
2022-10-17 11:09:18 -07:00
Kubernetes Prow Robot 5c36a3c372 Merge pull request #110902 from 0xff-dev/master
convert int32 to pointer using library function
2022-10-14 08:48:46 -07:00
Han Kang 2bbd445f50 remove rate limiter metric as it is not in use
Change-Id: I91157653e3860eeecc3f572aee88da6ffc65faed
2022-10-13 13:07:11 -07:00