Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rosen91 opened this issue Apr 14, 2020 · 3 comments
Closed
Assignees
Labels
area/config Issues related to the config kind/bug Something isn't working

Comments

@rosen91
Copy link

rosen91 commented Apr 14, 2020

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

@rosen91 rosen91 changed the title Using non string vars in env does not convert to string Using integer or boolean string vars in env does not convert to string Apr 14, 2020
@FabianKramm
Copy link
Collaborator

@rosen91 thanks for reporting this issue! Yes seems like a bug, I'll fix this as soon as possible

@FabianKramm FabianKramm self-assigned this Apr 14, 2020
@FabianKramm FabianKramm added area/config Issues related to the config kind/bug Something isn't working labels Apr 14, 2020
@shaunc
Copy link
Contributor

shaunc commented Oct 13, 2022

Seems that this has regressed in devspace version 6.1.1?

I have in container env:

- name: MAX_SEND_INTERVAL
  value: "${MAX_SEND_INTERVAL}"

And in vars:

  MAX_SEND_INTERVAL:
    source: env

Render shows me:

            - name: MAX_SEND_INTERVAL
              value: 600

which does not deploy.

@lizardruss
Copy link
Collaborator

@shaunc It looks like the original fix was to add the option to force a string using $!{MAX_SEND_INTERVAL}. Can you try that and report back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config Issues related to the config kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants