[英]yaml parse error
When i run the helm install command the below line gives me the error: 当我运行helm install命令时,以下行给我错误:
args: [while [ 1 ]; do echo "hi" ; sleep 1; done;]
Error: 错误:
Error: YAML parse error
converting YAML to JSON: yaml: line 27: did not find expected ',' or ']'
Square brackets have special meaning in YAML (they indicate a flow sequence, ie an inline array). 方括号在YAML中具有特殊含义(它们表示流序列,即内联数组)。 You need to quote that scalar (string):
您需要引用该标量(字符串):
args: [ 'while [ 1 ]; do echo "I am awake" ; sleep 1; done;' ]
...or make it a block scalar and use the literal indicator, |
...或使其成为块标量并使用文字指示符
|
: :
args:
- |
while [ 1 ]; do echo "I am awake" ; sleep 1; done;
Both of these produce the same JSON : 这两个都产生相同的JSON :
{
"args": [
"while [ 1 ]; do echo \"I am awake\" ; sleep 1; done;"
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.