Skip to content

Filter gke-clusters by labels #7375

Answered by rockhowse
dbarranco asked this question in General
Discussion options

You must be logged in to vote

Ok, looks like you can work around this by using Generic Filters:

There's not a deep link to the section but here it is:

For my use case, I was able to successfully update the policy file:

vars:
  sample-tag-filters: &sample-tag-filters
    - resourceLabels.env: present

  policies:
  - name: gke-cluster-sample
    resource: gcp.gke-cluster
    filters:
      - and: *sample-tag-filters

Note that I changed it from a string, to a non-string value. This format takes advantage of the JSMEPath format as shown in the Generic Filters docs.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@rockhowse
Comment options

Answer selected by ajkerrigan
@thisisshi
Comment options

@dbarranco
Comment options

@ajkerrigan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
Converted from issue

This discussion was converted from issue #6053 on June 01, 2022 15:00.