Repository navigation
serviceaccount: read local Secrets from the lister only - #4542
Conversation
The local lookup no longer falls back to a live GET on a lister miss, so a missing Secret does not turn into a request to the shard on every call. Signed-off-by: mjudeikis-bot <263128906+mjudeikis-bot@users.noreply.github.com>
|
Hi @mjudeikis-bot. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
LGTM label has been added. DetailsGit tree hash: 3416a6d8bb162dec9531f87980df2b3cddc47e1c |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ntnn The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Restores the local Secret getter in
pkg/server/serviceaccount/cache.goto a plain lister read (secretsLister.Secrets(namespace).Get(name)). The live GET fallback added in #4528 on every lister miss is removed, so a missing Secret (e.g. a stale or bogus token reference) no longer costs a request to the shard per call.Note on the issue's premise:
shardlookup.Lookup.Get(pkg/shardlookup/lookup.go) sends local keys only to thelocalfunc and non-local keys only to the TTL-cachedfetchfunc;fetchis not a fallback for local misses. After this change a local Secret absent from the informer returns NotFound. The Secret informer is filtered totype=kubernetes.io/service-account-token, and this getter is only used to resolve token Secrets, so that is the expected result. The one remaining edge is a token Secret created moments before the informer observes it, which fails until the informer catches up.Requested in #4540 (comment)
What Type of PR Is This?
/kind cleanup
Related Issue(s)
Fixes #4540
Release Notes
Tested:
go build ./pkg/server/...,go vet ./pkg/server/serviceaccount/. golangci-lint is not available in my environment. No unit test added: the package has no existing tests and the getter needs cluster-aware informers to construct.