yaml 解析错误
yaml parse error
当我 运行 helm install 命令时,下面的行给我错误:
args: [while [ 1 ]; do echo "hi" ; sleep 1; done;]
错误:
Error: YAML parse error
converting YAML to JSON: yaml: line 27: did not find expected ',' or ']'
方括号在YAML中有特殊含义(它们表示流序列,即内联数组)。您需要引用该标量(字符串):
args: [ 'while [ 1 ]; do echo "I am awake" ; sleep 1; done;' ]
...或将其设为块标量并使用文字指示符,|
:
args:
- |
while [ 1 ]; do echo "I am awake" ; sleep 1; done;
{
"args": [
"while [ 1 ]; do echo \"I am awake\" ; sleep 1; done;"
]
}
当我 运行 helm install 命令时,下面的行给我错误:
args: [while [ 1 ]; do echo "hi" ; sleep 1; done;]
错误:
Error: YAML parse error
converting YAML to JSON: yaml: line 27: did not find expected ',' or ']'
方括号在YAML中有特殊含义(它们表示流序列,即内联数组)。您需要引用该标量(字符串):
args: [ 'while [ 1 ]; do echo "I am awake" ; sleep 1; done;' ]
...或将其设为块标量并使用文字指示符,|
:
args:
- |
while [ 1 ]; do echo "I am awake" ; sleep 1; done;
{
"args": [
"while [ 1 ]; do echo \"I am awake\" ; sleep 1; done;"
]
}