我尝试在广告连播中设置命令,并且在尝试创建广告连播时向我显示此错误
错误:解析pod.yaml时发生错误:将YAML转换为JSON时发生错误:yaml: 第17行:未找到预期的','或']'
pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: iafoxtsdemo9
labels:
app: iafoxtest
name: iafoxtsdemo9
spec:
containers:
- name: iafox
image: xxxxx.azurecr.io/xxxxx:3.5-7-g24789b7
ports:
- containerPort: 8080
env:
- name: DBNAME
value: "ts-demo1"
command: ["/bin/bash"]
args: ["-c","cd /usr/local/tomcat/bin/ && sed -i "s~database\=.*;~database=${DBNAME};~" setenv.sh"]
imagePullSecrets:
- name: iafoxkey
答案 0 :(得分:1)
您在args中嵌套了双引号,这破坏了解析。
args: ["-c","cd /usr/local/tomcat/bin/ && sed -i \"s~database\=.*;~database=${DBNAME};~\" setenv.sh"]