Skip to content

Using integer or boolean string vars in env does not convert to string #1069

@rosen91

Description

@rosen91

What happened?
Defining an integer or boolean variable using the following syntax

  • name: GATEWAY_MAIL_PORT
    source: env
    default: "2525"

And referencing it in the env part

  • name: MAIL_PORT
    value: "${GATEWAY_MAIL_PORT}"

Gives the following error
cannot patch "api-gateway" with kind Deployment: v1.Deployment.Spec: v1.DeploymentSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container: v1.Container.Env: []v1.EnvVar: v1.EnvVar.Value: ReadString: expects " or n, but found 2, error found in #10 byte of ...|,"value":2525}

devspace render gives the following output

  • name: MAIL_PORT
    value: 2525

What did you expect to happen instead?
That the variable would be converted and inserted as a string
devspace render should output

  • name: MAIL_PORT
    value: "2525"

How can we reproduce the bug? (as minimally and precisely as possible)

Local Environment:

  • DevSpace Version: 4.11.1
  • Operating System: mac
  • Deployment method: helm

Kubernetes Cluster:

  • Cloud Provider: google
  • Kubernetes Version: 1.15

Anything else we need to know?
Seems to be a common error, and solved via help pipe quote
https://helm.sh/docs/howto/charts_tips_and_tricks/#quote-strings-dont-quote-integers

/kind bug

Metadata

Metadata

Assignees

Labels

area/configIssues related to the configkind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions