You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jascott1 thank you for the reply. double quotes around the image: value results in the same behavior: image: "my-registry/elastalert:474915"
I also tried this: image: {{ .Values.global.dockerRegistry }}/{{ .Values.deployment.dockerImage }}:"{{ .Values.deployment.dockerTag }}" with this result:
@andiMenge Sorry I should have realized its getting stripped before it even makes it to the template. My guess is that this is happening during all the values merging where a lot of conversions take place but idk. Im not sure there is a way to force it to consider a number as a string. You could concatenate the whole image name (change the template and combine the --set values) but I assume you wouldn't be asking if that would suffice.
Does it keep the leading zero if you put it into the values.yaml with quotes?
@andiMenge So --set deployment.dockerTag=0474915 should look like --set deployment.dockerTag="0474915" for safety because if it is all digits, it will treat it as an int. If you wrap the value in quotes when you pass it in, the parser will treat it as a string and you won't lose that digit
Hello, just got bitten by this as well. If you quote the value in bash it will still be truncated because bash eats the quotes.
However if you double quote it like so: --set imageTag='"00123"' you now get a string... containing the quotes -_-
image: {{ .Values.image }}:{{.Values.imageTag}}
# expands to:
image: test:"000123"
# Also I can't quote the template placeholders or it breaks the parser.
FWIW, this issue still requires some pretty ugly workarounds in certain cases. If you want to set something to a bash variable, you need even more layers of quoting just to get the value into helm as a string. e.g.,
--set image.tag='"'$TAG'"'
otherwise you will get the literal string "$TAG"
Then you have to strip out the literal ""s later in the template e.g.,
Hi @thomastaylor312 I'm not having the exact problem mentioned in this issue, I just found the discussion here useful in working around a related issue. My issue is that when I set that value using --set image.tag="3213841", it gets interpreted as a numeric value and comes out of {{ .Values.image.tag }} looking like 3.213841e+06 in the rendered yaml. So I needed a way of forcing it to be interpreted as a string. Should I open a separate issue to discuss?
Activity
[-]--set integer with leading zero gets truncated [/-][+]integer with leading zero gets truncated [/+]jascott1 commentedon Jul 19, 2017
@andiMenge Have you tried putting double-quotes around
image:value?andiMenge commentedon Jul 20, 2017
@jascott1 thank you for the reply. double quotes around the
image:value results in the same behavior:image: "my-registry/elastalert:474915"I also tried this:
image: {{ .Values.global.dockerRegistry }}/{{ .Values.deployment.dockerImage }}:"{{ .Values.deployment.dockerTag }}"with this result:image: registry.ucp.fhm.de/elastalert:"474915"jascott1 commentedon Jul 21, 2017
@andiMenge Sorry I should have realized its getting stripped before it even makes it to the template. My guess is that this is happening during all the values merging where a lot of conversions take place but idk. Im not sure there is a way to force it to consider a number as a string. You could concatenate the whole image name (change the template and combine the
--setvalues) but I assume you wouldn't be asking if that would suffice.Does it keep the leading zero if you put it into the values.yaml with quotes?
thomastaylor312 commentedon Jul 21, 2017
@andiMenge So
--set deployment.dockerTag=0474915should look like--set deployment.dockerTag="0474915"for safety because if it is all digits, it will treat it as anint. If you wrap the value in quotes when you pass it in, the parser will treat it as a string and you won't lose that digitandiMenge commentedon Jul 21, 2017
@thomastaylor312 unfortunately quoting the
"value"doesn't stop helm from truncating it. I tried that as well as some other quoting styles.thomastaylor312 commentedon Jul 21, 2017
Dang, well I'll have to dig into the code that parses
--setand see what we can doTimbus commentedon Jul 26, 2017
Hello, just got bitten by this as well. If you quote the value in bash it will still be truncated because bash eats the quotes.
However if you double quote it like so:
--set imageTag='"00123"'you now get a string... containing the quotes -_-Kinda painful.
Quote the git tag when deploying from travis
jiacona commentedon Nov 10, 2017
FWIW, this issue still requires some pretty ugly workarounds in certain cases. If you want to set something to a bash variable, you need even more layers of quoting just to get the value into helm as a string. e.g.,
--set image.tag='"'$TAG'"'otherwise you will get the literal string
"$TAG"Then you have to strip out the literal
""s later in the template e.g.,image: "{{ .Values.image.repository }}:{{ .Values.image.tag | replace "\"" ""}}"thomastaylor312 commentedon Nov 11, 2017
@jiacona This was fixed in Helm 2.6.0, are you still having issues?
jiacona commentedon Nov 14, 2017
Hi @thomastaylor312 I'm not having the exact problem mentioned in this issue, I just found the discussion here useful in working around a related issue. My issue is that when I set that value using
--set image.tag="3213841", it gets interpreted as a numeric value and comes out of{{ .Values.image.tag }}looking like3.213841e+06in the rendered yaml. So I needed a way of forcing it to be interpreted as a string. Should I open a separate issue to discuss?thomastaylor312 commentedon Nov 16, 2017
@jiacona Yes please. Feel free to ping me in the issue you create