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

operator/hierarchy: stop using field selector when listing Secrets & ConfigMaps #1340

Merged
merged 1 commit into from
Feb 1, 2022

Commits on Feb 1, 2022

  1. operator/hierarchy: stop using field selector when listing Secrets & …

    …ConfigMaps
    
    The initial implementation of hierarchy.KeySelector injected a
    FieldSelector when listing Secrets and ConfigMaps to immediately return
    the single object being queried for.
    
    This causes a problem with the client generated by the
    controller-runtime framework, where the client is wrapped in a cache and
    field indexer (where only the namespace is indexed by default).
    
    This commit avoids using the field selector and the index lookup. The
    resulting behavior aligns more closely with discovering other resources
    in the hierarchy (i.e., ServiceMonitors), where the List call is also
    insufficient and needs post-processing via Matches to find the final
    list of resources.
    
    Given the controller-runtime client uses an informer for reads, all
    relevant Secrets and ConfigMaps are already in-memory anyway, and using
    the index for a faster List is a bit of an over-optimization at the
    moment.
    rfratto committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    19dbdec View commit details
    Browse the repository at this point in the history