* 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>
* 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.
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.
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>
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>
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>
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>
* 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
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".
* 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
* 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>
- 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
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>
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>