Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kubernetes): Fix all agents caching cluster-scoped resources #4128

Merged
merged 6 commits into from
Oct 29, 2019
Merged

fix(kubernetes): Fix all agents caching cluster-scoped resources #4128

merged 6 commits into from
Oct 29, 2019

Commits on Oct 29, 2019

  1. 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.
    ezimanyi committed Oct 29, 2019
    Configuration menu
    Copy the full SHA
    7723246 View commit details
    Browse the repository at this point in the history
  2. 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).
    ezimanyi committed Oct 29, 2019
    Configuration menu
    Copy the full SHA
    7bee271 View commit details
    Browse the repository at this point in the history
  3. 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.
    ezimanyi committed Oct 29, 2019
    Configuration menu
    Copy the full SHA
    130917d View commit details
    Browse the repository at this point in the history
  4. 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.
    ezimanyi committed Oct 29, 2019
    Configuration menu
    Copy the full SHA
    39264f9 View commit details
    Browse the repository at this point in the history
  5. 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.
    ezimanyi committed Oct 29, 2019
    Configuration menu
    Copy the full SHA
    ac1980a View commit details
    Browse the repository at this point in the history
  6. 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.
    ezimanyi committed Oct 29, 2019
    Configuration menu
    Copy the full SHA
    38fc10c View commit details
    Browse the repository at this point in the history