-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
rewrite template.data keys #464
Copy link
Copy link
Closed
Labels
area/templatingIssues / Pull Requests related to templating enginesIssues / Pull Requests related to templating engineskind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Milestone
Description
Describe the solution you'd like
When templating from multiple sources (data and dataFrom config), be able to render in the template all values from the dataFrom secret with the values from the data secret.
What is the added value?
This allow for a less verbose ExternalSecret object and more flexible, as adding / removing keys from the dataFrom secret source will be reflected in the secret without any object change
Give us examples of the outcome
Now we need to do the config below. Explicit list the keys from the dataFrom field, ENV1FROMDATAFROM and ENV2FROMDATAFROM, in this example.
apiVersion: external-secrets.io/v1alpha1
kind: ExternalSecret
metadata:
name: my-server-env
spec:
secretStoreRef:
name: my-cluster-secret-store
kind: ClusterSecretStore
dataFrom:
- key: /my-server
data:
- secretKey: S3_BUCKET
remoteRef:
key: /my-server/S3_BUCKET
- secretKey: AWS_ACCESS_KEY_ID
remoteRef:
key: /my-server/AWS_ACCESS_KEY_ID
- secretKey: AWS_SECRET_ACCESS_KEY
remoteRef:
key: /my-server/AWS_SECRET_ACCESS_KEY
target:
name: my-server-env
creationPolicy: Owner
template:
data:
ENV1FROMDATAFROM: |
{{ .ENV1FROMDATAFROM | toString }}
ENV2FROMDATAFROM: |
{{ .ENV1FROMDATAFROM | toString }}
S3_BUCKET: |
{{ .S3_BUCKET | toString }}
AWS_ACCESS_KEY_ID: |
{{ .AWS_ACCESS_KEY_ID | toString }}
AWS_SECRET_ACCESS_KEY: |
{{ .AWS_SECRET_ACCESS_KEY | toString }}Ideally if we could have the possibility to do templating directly in the template.data field:
template:
data:
{{- range $key, $val := . }}
{{ $key }}: {{ $val | toString }}
{{- end}}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/templatingIssues / Pull Requests related to templating enginesIssues / Pull Requests related to templating engineskind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Type
Projects
Status
Done