companyinfo / helm-charts

Company.info Helm charts repository
https://companyinfo.github.io/helm-charts
Apache License 2.0
68 stars 22 forks source link

fix: quote keys and values in template function `helmet.toEnvArray` #35

Open maarten-blokker opened 7 months ago

maarten-blokker commented 7 months ago

Fixes issue https://github.com/companyinfo/helm-charts/issues/34

For the Deployment object, both spec.template.spec.containers.env.name and spec.template.spec.containers.env.value should be treated as strings. Implementing quotes within the helmet.toEnvArray function guarantees that all template values are correctly recognized as strings.

After the change, the example in the issue will be rendered as:

...
    spec:
      restartPolicy: Always
      containers:
        - name: test
          image: docker.io/repo:latest
          imagePullPolicy: Always
          env:            
            - name: "SHOULD_BE_STRING"
              value: "true"
            - name: "SHOULD_BE_STRING_AS_WELL"
              value: "43"
...