Migrate the claim, pod, DeviceTaintRule, and ResourceSlice informer
event handlers from AddEventHandler to AddEventHandlerWithOptions,
passing the controller's contextual logger via cache.HandlerOptions.
This routes event-handler logging through the per-controller logger
instead of the global klog.Background(), matching the pattern already
used by the sibling resourceclaim controller.
The change is non-behavioral: the returned registration handles are
retained for HasSyncedChecker and RemoveEventHandler as before.
Moved the CloudNodeLifecycleController configuration fields out of the
KubeCloudSharedConfiguration, and created a dedicated component-specific
config package. Also moved the node-monitor-period, while keeping the
old flag (with deprecation message). No new flag for node-monitor-period
was added, due to
https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-flag-or-cli-argument.
processNextWorkItem only resets the workqueue rate limiter (queue.Forget) inside the requeueAfter != nil branch. When sync() returns (nil, nil) — no error and no requeue, rate limit is not reset.
Migrate plain AddEventHandler calls in the storageversion GC and
migrator controllers to AddEventHandlerWithOptions with
cache.HandlerOptions{Logger: &logger} so the contextual logger is
propagated into the informer handler goroutines.
The logger is already in scope at each call site (klog.FromContext(ctx)),
and the handler functions already accept a klog.Logger argument, so
this is a pure API migration with no behaviour change.
Fixes: https://github.com/kubernetes/kubernetes/issues/126379
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
When manageJob() needs to create replacement pods but defers creation
because a pod-failure backoff is still active, it returned a hardcoded
active=0 to the caller. Because no pods were actually created or deleted,
this left Status.Active=0 while Status.Ready still reflected the running
pods. The apiserver correctly rejects such updates ("cannot set more
ready pods than active") with a 422, which blocks flushing uncounted
terminated pods, removing finalizers, and updating job status, leaving
pods stuck Terminating with stale status.
Return the real active count from both backoff early-returns instead,
since the deferral does not change the number of active pods.
Issue: https://github.com/kubernetes/kubernetes/issues/139428
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>
* 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>