How to get values from yaml in different profiles (separated with '---') #1353
Unanswered
haimiandbb
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
YAML Demo manager.yaml
spec:
serviceName: "cache-manager-0"
selector:
matchLabels:
app: cache-manager-0
replicas: 1
template:
spec:
containers:
- name: manager
image: cache-manager:master-202208120524
---
spec:
serviceName: "cache-manager-1"
selector:
matchLabels:
app: cache-manager-1
replicas: 1
template:
spec:
containers:
- name: manager
image: cache-manager:master-202208120404
I use command in groovy: def res = sh returnStdout: true, script: "yq r manager.yaml 'spec.template.spec.containers.(name==manager).image' "
only get the first (res = cache-manager:master-202208120524)
What should I do to get the second one?
And how to update the second one ?
Beta Was this translation helpful? Give feedback.
All reactions