Open
Conversation
Signed-off-by: Eric Pickard <piceri@github.com>
Signed-off-by: Eric Pickard <piceri@github.com>
Signed-off-by: Eric Pickard <piceri@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a bounded timeout to the controller’s informer cache sync phase so the controller can fail fast instead of hanging indefinitely when informers can’t sync (e.g., due to missing RBAC permissions).
Changes:
- Introduces a default informer sync timeout (60s) and wires it into
Controller.Run()via a timeout-derived context. - Improves the cache-sync failure error message to hint at likely RBAC causes.
- Adds a unit test intended to verify
Run()returns when informer cache sync is blocked.
Show a summary per file
| File | Description |
|---|---|
internal/controller/controller.go |
Adds a controller-level informer sync timeout and uses it to bound WaitForCacheSync. |
internal/controller/controller_test.go |
Adds a test that simulates blocked informer listing to ensure sync timeout triggers. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 3
Signed-off-by: Eric Pickard <piceri@github.com>
Signed-off-by: Eric Pickard <piceri@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes adds a timeout to the informer sync process in the controller. Without this timeout, the controller can become stuck waiting for informers to sync.
For example, informers cannot sync if deployment tracker does not have the proper Kubernetes permissions but a lack of permissions does not trigger any fatal errors. This would result in the controller being stuck waiting for the sync to complete.