Repository navigation
rotator: filter secret cache by name - #590
Open
Hrishikeshkashyap wants to merge 1 commit into
Open
Hrishikeshkashyap wants to merge 1 commit into
Hrishikeshkashyap wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #590 +/- ##
==========================================
+ Coverage 57.16% 62.21% +5.04%
==========================================
Files 1 1
Lines 572 487 -85
==========================================
- Hits 327 303 -24
+ Misses 181 118 -63
- Partials 64 66 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Hrishikeshkashyap
force-pushed
the
fix/filter-secret-cache-by-name
branch
from
October 19, 2026 16:56
37d6bcc to
9939e36
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Hrishikesh Kashyap <hrkashyap@microsoft.com>
Hrishikeshkashyap
force-pushed
the
fix/filter-secret-cache-by-name
branch
from
October 20, 2026 13:21
9939e36 to
205f369
Compare
Author
|
@JaydipGabani Could you please take a look at this PR when you get a chance? Thanks! |
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.
Description
cert-controller manages a specific Secret containing the webhook TLS certificate. However, the current Secret cache watches all Secrets in the namespace, even though the rotator already knows the exact Secret it needs through
SecretKey.This change filters the Secret cache using
metadata.name, so it watches only the configured certificate Secret.Why
This enables consumers to apply least-privilege RBAC and restrict Secret access using
resourceNames, instead of requiring access to all Secrets in the namespace.The filter applies only to Secrets, so the existing webhook configuration informers remain unaffected.
As a secondary benefit, filtering the Secret cache also avoids caching and processing unrelated Secrets, reducing unnecessary watch traffic and cache usage.
Changes
cr.SecretKey.Name.