- squash isFailed and isSucceeeded under single isTerminalPhase
- remove dropParentName in favor of getParentNameAndOrdinal
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
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.
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.
* Fix goroutine leaks in ephemeral volume controller test
Use context.WithCancel and properly shut down the informer factory
and workqueue in TestSyncHandler to prevent goroutine leaks.
Previously, the test used context.Background() which never cancels,
leaving informer and workqueue goroutines running after test completion.
Now that context support has been added to tools/cache (#126387),
the informers can be cleanly shut down via context cancellation.
Also add goleak.VerifyTestMain to detect goroutine leak regressions.
* Remove year from copyright header in main_test.go
* Drop main_test.go per review feedback
* check the job owner reference in the cronjob reconcile loop
* use indexer to get jobs to be reconciled
* chore
* Update pkg/controller/cronjob/cronjob_controllerv2.go
Co-authored-by: Filip Křepinský <fkrepins@redhat.com>
* delete unnecessary comment
* move jobIndexer place
* Update pkg/controller/cronjob/cronjob_controllerv2.go
Co-authored-by: Maciej Szulik <soltysh@gmail.com>
* jobs -> jobsjobsToBeReconciled
* fix var name
---------
Co-authored-by: Filip Křepinský <fkrepins@redhat.com>
Co-authored-by: Maciej Szulik <soltysh@gmail.com>
and terminated pods for maxUnavailable
This change ensures that Parallel pod management in statefulset controller
counts old unavailable pods as candidates for rollouts, but leaving
terminating pods untouched. All the disruptions should always ensure
that the statefulset stays within defined maxUnavilable budget.
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
resourceclaimcontroller: fix incorrect SSA apply in syncPod method
The ResourceClaimController's syncPod method only includes new
resource claims in the server-side apply, not existing claims. Since
this controller is the owning fieldManager, SSA removes the missing
existing keys. This results in flapping between claims when more than
one claim is assigned to the Pod.
This fix includes the existing claims in the SSA request.
Signed-off-by: John Belamaric <jbelamaric@google.com>