kapp icon indicating copy to clipboard operation
kapp copied to clipboard

support path key prefix selection in Config

Open cwlbraa opened this issue 4 years ago • 0 comments

I'd like to write a rebase rule that always pulls all of the cert-manager.io/ annotations for secrets out of the cluster, but right now I think I have to write that like this:

rebaseRules:
- path: [metadata, annotations, "cert-manager.io/alt-names"]
  type: copy
  sources: [new, existing]
  resourceMatchers: &opaqueSecrets
  - apiVersionKindMatcher: {apiVersion: v1, kind: Secret, type: Opaque}

- path: [metadata, annotations, "cert-manager.io/certificate-name"]
  type: copy
  sources: [new, existing]
  resourceMatchers: *opaqueSecrets

- path: [metadata, annotations, "cert-manager.io/common-name"]
  type: copy
  sources: [new, existing]
  resourceMatchers: *opaqueSecrets

- path: [metadata, annotations, "cert-manager.io/ip-sans"]
  type: copy
  sources: [new, existing]
  resourceMatchers: *opaqueSecrets

- path: [metadata, annotations, "cert-manager.io/issuer-kind"]
  type: copy
  sources: [new, existing]
  resourceMatchers: *opaqueSecrets

- path: [metadata, annotations, "cert-manager.io/issuer-name"]
  type: copy
  sources: [new, existing]
  resourceMatchers: *opaqueSecrets

- path: [metadata, annotations, "cert-manager.io/uri-sans"]
  type: copy
  sources: [new, existing]
  resourceMatchers: *opaqueSecrets

when really what I want is something like:

rebaseRules:
- path: [metadata, annotations, {prefixed: "cert-manager.io/"}]
  type: copy
  sources: [new, existing]
  - apiVersionKindMatcher: {apiVersion: v1, kind: Secret, type: Opaque}

cwlbraa avatar Dec 18 '19 21:12 cwlbraa