我有一个像这样的 YAML 文件
apiVersion: "v1alpha1"
kind: "Druid"
metadata:
name: druid-dev-cluster
spec:
common.runtime.properties: |
# Zookeeper
druid.zk.service.host=cluster-zk-0.cluster-zk
druid.zk.paths.base=/druid
druid.zk.service.compress=false
我想替换 common.runtime.properties 中的属性之一。这是否支持使用 yq?当我正常尝试时它失败了
property=.spec.common.runtime.properties.druid.zk.service.host=cluster-zk-0.cluster-zk
OVERLAY= deploy/overlays/aws/common-runtime-properties.yaml
yq e "${property}" "$OVERLAY"/"$propertyType"
Error: Parsing expression: Lexer error: could not match text starting at 1:55 failing at 1:57.
unmatched text: "ti"
这适用于其他属性,例如
apiVersion: "v1alpha1"
kind: "Druid"
metadata:
name: druid-dev-cluster
spec:
nodes:
brokers:
nodeType: "broker"
druid.port: 8088
ingressAnnotations:
kubernetes.io/ingress.class: "plb.v1"