Repository navigation
Conversation
With watch.namespaces unset, GetCacheNamespaces returns only NamespaceAll, and newCacheNamespaces turned that into a single "" key in cache.Options.DefaultNamespaces. controller-runtime v0.18 builds a multi-namespace cache whenever DefaultNamespaces has an entry, and its List rejects any namespace that is not a key, so every namespaced list in CHK discovery failed with "unknown namespace for the cache". Return nil for NamespaceAll alone, so the keeper and backup managers get one cluster-wide cache. Signed-off-by: Myrian Koumgang <kmyriantek@gmail.com>
This branch has not been deployed
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.
Fixes #2117
With
watch.namespacesunset,GetCacheNamespaces()returns[""]andnewCacheNamespaces()(cmd/operator/app/init_retry.go) turns it intoDefaultNamespaces{"": {}}. controller-runtime v0.18.7 builds a multi-namespace cache wheneverDefaultNamespaceshas an entry, and itsListreturns "unknown namespace for the cache" for any namespace that isn't a key.Getfalls back to the""cache butListdoesn't, so the CHK discovery lists fail in every namespace.This makes
newCacheNamespaces()return nil when the only entry isNamespaceAll, socache.Newbuilds one cluster-wide cache. The keeper and backup managers both use the helper. Named namespaces and the regexp fallback don't change.TestCacheOptionsWatchAllNamespacesBuildsClusterWideCachefails on 0.28.0 and passes with the fix.cc @alex-zaitsev