Skip to content

Commit

Permalink
Merge pull request #108 from MediaMarktSaturn/application/fixMultiLin…
Browse files Browse the repository at this point in the history
…eSecrets

[Application] Fix multiline secrets
  • Loading branch information
heubeck committed Mar 15, 2024
2 parents 0f3fe62 + 19b5a99 commit 57a0043
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
33 changes: 33 additions & 0 deletions chart-tests/application/ci/test-multiline-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
resources:
requests:
cpu: 10m
memory: 50Mi
limits:
cpu: 100m
memory: 100Mi

encryptedSecret:
stringData:
key-no1: |
this is just
an ordinary
multiline string
key-no2: |
just
don't
let: anyone read this
configuration:
this-is: boring
here: |
we go
again
some: >
people always
will love yaml
why-not: |-
just
be
happy
2 changes: 1 addition & 1 deletion charts/application/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ maintainers:
- name: MediaMarktSaturn
url: https://github.com/MediaMarktSaturn
appVersion: 1.0.0
version: 1.14.1
version: 1.14.2
7 changes: 2 additions & 5 deletions charts/application/templates/k8s-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ metadata:
{{- if .Values.encryptedSecret.data }}
data:
{{- range $k, $v := .Values.encryptedSecret.data }}
{{ $k }}: |-
{{ $v | indent 6 }}
{{ $k }}: {{ $v | quote }}
{{- end }}
{{- end }}
{{- if .Values.encryptedSecret.stringData }}
stringData:
{{- range $k, $v := .Values.encryptedSecret.stringData }}
{{ $k }}: |-
{{ $v | indent 6 }}
{{ $k }}: {{ toYaml $v | indent 4 }}
{{- end }}
{{- end }}

{{- end }}

0 comments on commit 57a0043

Please sign in to comment.