-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix jsonpath usages #258
fix jsonpath usages #258
Conversation
KUBE_API_SERVERS=$(oc get po -n openshift-kube-apiserver -l apiserver -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}') | ||
# oc get po -n openshift-kube-apiserver -l apiserver -o jsonpath='{.items[*].metadata.name}' | ||
# kube-apiserver-master-0.example.com kube-apiserver-master-1.example.com kube-apiserver-master-2.example.com | ||
KUBE_API_SERVERS=$(oc get po -n openshift-kube-apiserver -l apiserver -o jsonpath='{.items[*].metadata.name}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for range unless we want to print them nicely somewhere
@@ -42,7 +42,7 @@ if [ $# -eq 0 ]; then | |||
fi | |||
|
|||
PIDS=() | |||
NODES="${*:-$(oc get nodes -o jsonpath='{range .items[*]}{@.metadata.name} {.status.nodeInfo.operatingSystem==linux}')}" | |||
NODES="${*:-$(oc get nodes -o jsonpath='{.items[?(@.status.nodeInfo.operatingSystem=="linux")].metadata.name}')}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filtering wasn't working properly before
/assign @soltysh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: atiratree, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
to fix incorrect usages of jsonpath (https://github.com/openshift/must-gather/pull/204/files#r683645122)