companyinfo / helm-charts

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

Change envVars from array to a map #20

Closed olenotron closed 11 months ago

olenotron commented 11 months ago

As a user of Helmet, I want to modify specific sections of envVars. However, it's not possible. This is because envVars is an array. Consequently, changing a single key is impossible since Helm overrides the entire set of variables. This PR fixes the open issue https://github.com/companyinfo/helm-charts/issues/19.

The solution involves changing the data type from an array to a map, like this:

# Current
envVars:
  - name: FOO
    value: "bar"
  - name: BOB
    value: "alice"

# New
envVars:
  FOO: "bar"
  BOB: "alive"
zevisert commented 11 months ago

Will valuesFrom still work with this format?

p-afraz commented 11 months ago

Will valuesFrom still work with this format?

@zevisert nice catch! this is a fix we can implement to support both cases:

envVars:
  FOO: "bar"
  BOB: 
    valueFrom:
      configMapKeyRef:
        name: "foo"
        key: "bar"

What do you think?

zevisert commented 11 months ago

@p-afraz Yeah, that format seems logical. Looking into the changes here now, the new helmet.dictToArray helper needs to be updated to support that.