Skip to content

Wrong helm values processing in secret.yaml template #380

@a-b-v

Description

@a-b-v

Describe the bug

If I set a value like fluentd.extraEnv.elk_port to the port number, then I get an error about the wrong type for the value

Reproduction steps

  1. Set variables
    ELK_PORT=9200
    CHART_URL='https://github.com/vmware/kube-fluentd-operator/releases/download/v1.16.8/log-router-0.4.0.tgz'
  2. Run helm
    helm upgrade -i kfo ${CHART_URL} --set fluentd.extraEnv.elk_port="$ELK_PORT" --set reloader.extraEnv.elk_port="$ELK_PORT"
  3. Get an error
    Error: UPGRADE FAILED: template: log-router/templates/secret.yaml:21:34: executing "log-router/templates/secret.yaml" at : wrong type for value; expected string; got int64

Expected behavior

helm runs without an error

Additional context

I suggest modifying the secret.yaml template, by adding a "| toString" in lines 21 and 23:

fluentd.{{ $key }}: {{ $value | toString | b64enc | quote }}
reloader.{{ $key }}: {{ $value | toString | b64enc | quote }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions