我有一个rancher-compose.yml文件,我使用这样的环境变量设置upgrade_strategy.start_first字段:
upgrade_strategy:
start_first: ${START_FIRST}
batch_size: 1
使用rancher-compose CLI运行时,出现以下错误:
ERRO[0000] Failed to open project origami-svcproxy: yaml: unmarshal errors:
line 28: cannot unmarshal !!str `false` into bool
在调试中运行时,我看到以下yaml:
upgrade_strategy:
batch_size: 1
start_first: "false" # <-- notice the surrounding quotes, missing from the rest of the variable replacements
如何动态设置此字段?
答案 0 :(得分:1)
我遇到了同样的问题,并使用了不同的策略来解决问题。第一步是将docker-compose.yml
转换为模板docker-compose.yml.tpl
。其次,使用模板逻辑来获取布尔变量的值。
upgrade_strategy:
start_first: {{ .Values.START_FIRST }}
batch_size: 1