bjw-s / helm-charts

A collection of Helm charts
https://bernd-schorgers.github.io/helm-charts/
Apache License 2.0
566 stars 106 forks source link

Support mulitline stringData secret #161

Closed dani-CO-CN closed 1 year ago

dani-CO-CN commented 1 year ago

Details

What steps did you take and what happened:

Inject a x509 certificate as stringData for a secret. I tried multiple yaml formatters but failed (| or |-)

secrets:
  secret:
    enabled: true
    stringData: |-
      aldfaldflaf
      adfadfadf

What did you expect to happen:

That the secret just has a literal block with

stringData: |-
    aldfaldflaf
    adfadfadf

but instead it is rendered as

stringData:
  |-
    aldfaldflaf
    adfadfadf

Anything else you would like to add:

Additional Information:

bjw-s commented 1 year ago

Thanks for the bug report! I'll look in to it and see about fixing it

bjw-s commented 1 year ago

I took some time to look at this, and this isn't actually a bug... Kubernetes expects key-value pairs for the stringData field so the correct syntax for stringData would be this:

secrets:
  secret:
    enabled: true
    stringData:
      secret.crt: |-
        aldfaldflaf
        adfadfadf