open-policy-agent / open-policy-agent/cert-controller
rotator.AddRotator doesn't exit when the process is terminated
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 109
- Forks
- 48
- Avg merge
- 19h 20m
- Merged PRs (30d)
- 6
Description
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at pkg/rotator/rotator.go around line 110 and inspect how rotator.AddRotator creates the rotator.ReconcileWH and supplies its context. Confirm how the controller manager uses that watch during shutdown. Done means a controller using AddRotator exits promptly and gracefully after SIGTERM or SIGINT instead of waiting for the 30-second graceful shutdown timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- backend, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100