Skip to content

Is it possible to filter resources /invert a selector #5188

Closed Answered by btrepp
btrepp asked this question in Q&A
Discussion options

You must be logged in to vote

I found.. a very weird way to do this.

First 1) create a kustomization wrapping your 'upstream' and add an annotation

resources:
- src/upstream/somefile.yaml

commonAnnotations:
  vendor: "true"

In this case, I'm using git submodules

  1. Now use this as a base elsewhere
resources:
- ../../../vendor/

patches:
- target:
    kind: CustomResourceDefinition
  patch: |
    - op: remove
      path: /metadata/annotations/vendor
- target:
    annotationSelector: "vendor=true"
  patch: |
    $patch: delete
    kind: IGNORED
    metadata:
      name: DOES NOT MATTER

What we are doing is, adding an annotation, removing that for the 'resources we want'. Then deleting all the resources that still mat…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by btrepp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant