jkroepke / helm-secrets

A helm plugin that help manage secrets with Git workflow and store them anywhere
https://github.com/jkroepke/helm-secrets/wiki
Apache License 2.0
1.53k stars 129 forks source link

Multiline strings passed with --set being cut #404

Closed metrictwo closed 1 year ago

metrictwo commented 1 year ago

Current Behavior

When passing a multi-line value via --set, only the first line of the value is available to the chart when using the plugin.

Expected Behavior

The full multi-line value is available to the chart, as is the case with the regular helm command.

Steps To Reproduce

Make an example chart with the following template:

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: multiline
data:
  multiline: {{ .Values.multiline | quote }}

When templating this chart with a multiline value, only the first line is available:

$ helm secrets template helm-charts/multiline \
  --set multiline="key1:
  key2: value"
---
# Source: multiline/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: multiline
data:
  multiline: "key1:"

When using the bare helm command, the full string is available:

$ helm template helm-charts/multiline --set multiline="key1:
  key2: value"
---
# Source: multiline/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: multiline
data:
  multiline: "key1:\n  key2: value"

Environment

Anything else?

For context, we tried to enable the helm wrapper in our argocd-repo-server image to support multi-source applications. The secret functionality worked perfectly, but we noticed this issue with a dynamic multiline parameter and had to roll back.

jkroepke commented 1 year ago

Thanks for the report. I was able to reproduce it and should now resolved on main

metrictwo commented 1 year ago

Fantastic, thank you very much @jkroepke. Do you know when the next release is going to be cut?