If you use rotator.AddRotator to build a rotator.ReconcileWH and add it to the controller manager, it uses a context.Background() which is never cancelled. This means the Watch added to the controller manager is never terminated, causing the controller manager to wait its entire Options.GracefulShutdownTimeout (default: 30s) before exiting after SIGTERM/SIGINT.
https://github.com/open-policy-agent/cert-controller/blob/master/pkg/rotator/rotator.go#L110
Can rotator.AddRotator be made to accept a context and pass it through so the controller can exit quickly & gracefully?
Or am I using it wrong?
If you use
rotator.AddRotatorto build arotator.ReconcileWHand add it to the controller manager, it uses acontext.Background()which is never cancelled. This means the Watch added to the controller manager is never terminated, causing the controller manager to wait its entireOptions.GracefulShutdownTimeout(default: 30s) before exiting after SIGTERM/SIGINT.https://github.com/open-policy-agent/cert-controller/blob/master/pkg/rotator/rotator.go#L110
Can
rotator.AddRotatorbe made to accept a context and pass it through so the controller can exit quickly & gracefully?Or am I using it wrong?