You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Add graceful shutdown with Runnable pattern to prevent stuck finalizers
Fixes RHOAIENG-42316: Stuck Trainer CR when disabling Trainer component
Changes:
- Implement GracefulShutdownRunnable using controller-runtime pattern
- Register Runnable in SetupControllers to run during context cancellation
- GracefulShutdown runs while webhook server is draining (not after it's dead)
- Fix test/integration/framework.go to handle 3-return-value SetupControllers
- Add comprehensive unit tests (10/10 passing)
The Runnable pattern ensures graceful shutdown executes when SIGTERM is
received but BEFORE the webhook server fully stops, allowing client.Update()
to successfully remove finalizers from terminating resources.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0 commit comments