shell-operator icon indicating copy to clipboard operation
shell-operator copied to clipboard

secretKeyRef

Open diafour opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe.

Describe the solution you'd like to see

Automatic way to insert a field from the Secret to the field in CR during filtering and in the snapshot. The variant of configuration can be like this:

Binding:
   configVersion: v1
   kubernetes:
   - name: cr_objects
     apiVersion: my/v1beta2
     kind: MyKind
     includeSnapshotsFrom: [cr_objects]
     namespace: ...
     jqFilter: .spec.remoteWrite
     secretKeyRefs:
       - path: .spec.basicAuth.usernameSecretKeyRef
         to: .spec.basicAuth.username
         optional: True|False
       - path: .spec.basicAuth.passwordSecretKeyRef
         to: .spec.basicAuth.password
         optional: True|False

CR:

apiVersion: my/v1beta2
kind: MyKind
metadata:
  name: test
spec:
  url: https://some-url.com/some-endpoint
  basicAuth:
    username: lskdjflsdkfj
    password:
    usernameSecretKeyRef:
      namespace: default
      name: basic-auth-for-some-url
      key: username
      error: No such secret
    passwordSecretKeyRef:
      namespace: default
      name: basic-auth-for-some-url
      key: username
      error: No such secret

Describe alternatives you've considered

Additional context

diafour avatar Jun 11 '21 07:06 diafour