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>
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
* feat: Provide previous replica count for deployment/replica set scale up/down event
Signed-off-by: GitHub <noreply@github.com>
* change format of event
Co-authored-by: Maciej Szulik <soltysh@gmail.com>
Co-authored-by: Maciej Szulik <soltysh@gmail.com>