我想设置docker image存储库并使用--set
从外部标记值。在我的部署 list yaml文件中,我写道:
image: "{{ .Values.image.awesomeapp.repository }}:{{ .Values.image.awesomeapp.tag | quote }}"
并以这种方式运行
Helm
:helm install charts/awesomeapp \
--set image.awesomeapp.repository=1234567890.dkr.ecr.ap-northeast-1.amazonaws.com/awesomeapp \
--set image.awesomeapp.tag=20180131010101
但是失败了:
Failed to apply default image tag "1234567890.dkr.ecr.ap-northeast-1.amazonaws.com/awesomeapp:\"2.01801310101013e+13\"": couldn't parse image reference "1234567890.dkr.ecr.ap-northeast-1.amazonaws.com/orange-battle:\"2.01801310101013e+13\"": invalid reference format
为什么无法正确暂停图像标签?
最佳答案
这是一个掌 Helm bug:
helm install --set tag=20161216
ends up in scientific notation in the template and that's because{{ typeOf .Value.tag }}
yieldsfloat64
.
它已经修复,并且Adding --set-string flag to force string values pull请求已合并。因此,新的标记
--set-string
将在一段时间后添加到helm
中。如果必须使用旧版本的
helm
,则可能有以下解决方法:1. 部署 list yaml文件应更改为:
image: {{ .Values.image.awesomeapp.repository }}:{{ .Values.image.awesomeapp.tag | replace ":" "" }}
2. 我们需要在使用
:
的值之前定义此额外符号--set
:helm install charts/awesomeapp \
--set image.awesomeapp.repository=1234567890.dkr.ecr.ap-northeast-1.amazonaws.com/awesomeapp \
--set image.awesomeapp.tag=:20180131010101
关于image - 无法使用Helm将长数字字符串解析为值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48533657/