Skip to content

Cannot set helm values for keys containing '.' #14

@jarnfast

Description

@jarnfast

In version 0.1.9 the following hack was introduced:

for _, k := range setKeys {
// Hack unitl helm introduce `--set-literal` for complex keys
// see https://github.com/helm/helm/issues/4030
// TODO : Fix this later upon `--set-literal` introduction
forcePointEscaping := strings.Replace(k, ".", "\\.", -1)
cmd.Args = append(cmd.Args, "--set", fmt.Sprintf("%s=%s", forcePointEscaping, step.Set[k]))

This appears to escape any . found in the keys for helm causing helm not to be able to override the wanted values.

From porter.yaml:

 - helm3:
      description: "Install Harbor"
      name: harbor
      chart: ./charts/harbor.tgz
      namespace: harbor
      replace: true
      wait: true
      set:
        database.external.host: "{{ bundle.parameters.database_host }}"
       <snipped>
      values:
        - valuefiles/harbor.yaml

Example from 0.1.8:

/cnab/app/mixins/helm3/helm3-runtime install --debug
/usr/local/bin/helm3 helm3 install harbor ./charts/harbor.tgz --namespace harbor --replace --wait \
  --values valuefiles/harbor.yaml --set database.external.host=host.docker.internal \
  <snipped>

Example from 0.1.9+:

/cnab/app/mixins/helm3/helm3-runtime install --debug
/usr/local/bin/helm3 helm3 install harbor ./charts/harbor.tgz --namespace harbor --replace --wait \
  --values valuefiles/harbor.yaml --set database\.external\.host=host.docker.internal \
  <snipped>

Expected outcome is that the rendered charts use host.docker.internal but actual behavior is that they're rendered using the default value defined in the chart's values.yaml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions