Add a example for union operator in the shell env (#16282)
In the current example, single quotes are used, but the union operator can be confusing.
Incorrect:
`kubectl get pod -o=jsonpath='{.items[*]['metadata.name','spec.nodeName']}'`
Correct:
`kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'status.capacity']}"`
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
849dc428db
commit
e5863effe6
@@ -85,6 +85,7 @@ kubectl get pods -o json
|
|||||||
kubectl get pods -o=jsonpath='{@}'
|
kubectl get pods -o=jsonpath='{@}'
|
||||||
kubectl get pods -o=jsonpath='{.items[0]}'
|
kubectl get pods -o=jsonpath='{.items[0]}'
|
||||||
kubectl get pods -o=jsonpath='{.items[0].metadata.name}'
|
kubectl get pods -o=jsonpath='{.items[0].metadata.name}'
|
||||||
|
kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'status.capacity']}"
|
||||||
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}'
|
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user