-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rotator.AddRotator doesn't exit when the process is terminated #42
Comments
I don't think the watch uses that context. Here is the code that sets up the controller: cert-controller/pkg/rotator/rotator.go Lines 568 to 595 in 54af894
IIRC controller-runtime registers the intent for a watch, but actually starts it via the manager, which passes on the context (though I could be misremembering). The background context appears to be passed into the various client.Get() calls that occur during a reconcile event. |
If you use
rotator.AddRotator
to build arotator.ReconcileWH
and 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.AddRotator
be made to accept a context and pass it through so the controller can exit quickly & gracefully?Or am I using it wrong?
The text was updated successfully, but these errors were encountered: