我有以下要替换命令字段的 yaml
有
apiVersion: batch/v1
kind: Job
metadata:
name: test004
spec:
template:
spec:
containers:
- name: "eee"
image: "test"
command: ["a", "b", "c"]
想
apiVersion: batch/v1
kind: Job
metadata:
name: test004
spec:
template:
spec:
containers:
- name: "eee"
image: "test"
command: ["a", "b", "c", "d"]
yq -i n --style myfile.yaml 'spec.template.spec.containers[0].command' "["a", "b", "c","d"]"
有没有办法用 wq 来实现这一点,我尝试使用样式但没有成功,如果我将它更改为简单的字符串,它可以工作,但当我想传递完整数组时,你知道吗?