IMIO / helm-plausible-analytics

Helm Chart for Plausible Analytics
Apache License 2.0
10 stars 10 forks source link

[FIX]: Set correct indentation for included env from .Values.extraEnv #7

Closed ptitmouton closed 7 months ago

ptitmouton commented 7 months ago

Hi,

I found an issue with the extraEnv option introduced in #4

Adding the following option to values.yaml:

extraEnv:
  - name: NAME
    value: VALUE
  - name: OTHER
    value: VALUE2

Leads to the following deployment.yaml in the template (which fails to deploy):

<...>
            - name: CLICKHOUSE_DATABASE_URL
              valueFrom:
                secretKeyRef:
                  key: CLICKHOUSE_DATABASE_URL
                  name: plausible-plausible-analytics
                        - name: NAME
            value: VALUE
          - name: OTHER
            value: VALUE2
<...>

There are two problems with https://github.com/IMIO/helm-plausible-analytics/blob/f480d867bbfa6d028830cd05a6d3e30cb4ffa98e/templates/deployment.yaml#L225

  1. The first line is too much indented. This is because the spaces before {{ toYaml .Values.extraEnv | indent 10 }} are included in the output template
  2. The required indentation should be 12, not 10

In the hope I can help with this PR.

Checklist

alexnuttinck commented 7 months ago

Thanks @ptitmouton! I also made a fix, I changed the indent function into the nindentfunction for extraEnv. Let me now if all work for you.

ptitmouton commented 7 months ago

I did not know about nindent. Works perfectly, thank you!