在云构建日志中
"Running the following command: kubectl [get httproutes.gateway.networking.k8s.io --field-selector=metadata.name=test-name-http-route --output=json | jq -r '.spec.rules[]?.backendRefs[]? | select(.name == "test-name-service")']"
}
error: unable to match a printer suitable for the output format "json | jq -r '.spec.rules[]?.backendRefs[]? | select(.name == \"test-name-service\")'", allowed formats are: custom-columns,custom-columns-file,go-template,go-template-file,json,jsonpath,jsonpath-as-json,jsonpath-file,name,template,templatefile,wide,yaml
是因为云构建中没有安装
jq
吗?
我能够直接在
Google Cloud Shell
中运行该命令,没有错误:
kubectl get httproutes.gateway.networking.k8s.io --field-selector=metadata.name=test-name-http-route --output=json | jq -r '.spec.rules[]?.backendRefs[]? | select(.name == "test-name-service")'
结果
jq
没有安装在我用来执行命令的映像中。