getporter / helm2-mixin

Helm mixin for Porter
https://porter.sh/mixins/helm
Apache License 2.0
13 stars 7 forks source link

Support nested set values #31

Closed vdice closed 2 years ago

vdice commented 5 years ago

Currently, we unmarshal the set block in a given install/upgrade action step for this mixin from a provided porter.yaml into a map[string]string struct. This means the input yaml needs to concatenate keys into one line (that are usually multi-level/nested in yaml).

So, a section looking like the following in standard yaml,

livenessProbe:
  initialDelaySeconds: 30

currently needs to be input as:

livenessProbe.initialDelaySeconds: 30

We'd like to support nested values for this block such that the first yaml example above would translate to a --set livenessProbe.initialDelaySeconds=30 on the actual invoked helm command. (Note, there may be multiple-nested values and various levels of nesting to be supported.)

MChorfa commented 4 years ago

Quick Note: We tested multiple lines scenario for nested values, we foud that it is very challenging to maintain, for example:

    --set grafana.'grafana\.ini'.'auth\.generic_oauth'.client_id=${ARM_ENTREPRISE_CLIENT_ID} \
    --set grafana.'grafana\.ini'.'auth\.generic_oauth'.client_secret=${ARM_ENTREPRISE_CLIENT_SECRET} \
    --set grafana.'grafana\.ini'.'auth\.generic_oauth'.auth_url=https://login.microsoftonline.com/${ARM_TENANT_ID}/oauth2/authorize \
    --set grafana.'grafana\.ini'.'auth\.generic_oauth'.token_url=https://login.microsoftonline.com/${ARM_TENANT_ID}/oauth2/token \
    --set grafana.'grafana\.ini'.'auth\.generic_oauth'.api_url=https://login.microsoftonline.com/${ARM_TENANT_ID}/openid/userinfo \

We were successful by creating values file and set all the required nested values. by using the --values switch, so that way we only set the simple values with --set switch