-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kubernetes): Fix all agents caching cluster-scoped resources (#4128)
* refactor(kubernetes): Minor refactor of core caching agent test Pull some common logic out of ProcessOnDemandResult so that it can be reused when we need to process the results of a loadData request in an upcoming commit. * test(kubernetes): Add tests to loadData in core caching agent There are no tests of loadData() in the KubernetesCoreCachingAgent; add a simple test that validates a namespaced and cluster-scoped kind can be succesfully cached (ie, is returned from loadData and is persisted to the cache). * refactor(kubernetes): Immutable collections and nonnull annotations Make a few collections returned by the kubernetes caching agent immutable, and add some nonnull annotations that simplify the work of calling code. * refactor(kubernetes): Split caching of resources by scope This commit splits the work to cache kubernetes objects into two functions: the first caches namespace-scoped objects for all namespaces relevant for the caching agent, and the second caches all cluster-scoped resources. This means that we'll no longer try to read the cluster-scoped resources once per namespace and will read them once per caching agent. * fix(kubernetes): Fix all agents caching cluster-scoped resources Currently all caching agents are caching cluster-scoped resources; this should be delegated to a single agent so that we don't duplicate work. * fix(kubernetes): Remove duplicate test assertions I had intended the second set of assertions to be testing the contents of the cache. But it loadData doesn't actually update the cache (it just returns results to an outer function that stores the result) so we can't test that the cache is updated after calling loadData. Just remove the extra assertions.
- Loading branch information
Showing
7 changed files
with
237 additions
and
75 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.