Skip to content

Ensure chart env values are strings/quoted#140

Merged
hitman99 merged 2 commits into
movetokube:masterfrom
rjinski:fix-keep-secret-values
Feb 25, 2024
Merged

Ensure chart env values are strings/quoted#140
hitman99 merged 2 commits into
movetokube:masterfrom
rjinski:fix-keep-secret-values

Conversation

@rjinski
Copy link
Copy Markdown

@rjinski rjinski commented Dec 4, 2023

Trying to use KEEP_SECRET_NAME the values were interpolated as boolean.

values.yaml

env:
  KEEP_SECRET_NAME: "true"

Or helm template . --set "env.KEEP_SECRET_NAME=true"

Or helm_release terraform provider

resource "helm_release" "postgres_controller" {
 ...
  set {
    name  = "env.KEEP_SECRET_NAME"
    type  = "string"
    value = "true"
  }
  ...
}

Desired:

containers:
  env:
    - name: KEEP_SECRET_NAME
      value: "true"

Actual:

containers:
  env:
    - name: KEEP_SECRET_NAME
      value: true
json: cannot unmarshal bool into Go struct field EnvVar.spec.template.spec.containers.env.value of type string

Environment values must always be of type string

@reddec
Copy link
Copy Markdown
Contributor

reddec commented Dec 12, 2023

@rjinski as workaround

env:
  KEEP_SECRET_NAME: "'true'"

@gcaracuel
Copy link
Copy Markdown

This is absolutely not hurtful but needed as the workaround is not that easy to find. It safe enough to be merged.

@hitman99
Copy link
Copy Markdown
Member

Nice work.

@hitman99 hitman99 merged commit 027cc24 into movetokube:master Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants