-
Notifications
You must be signed in to change notification settings - Fork 15.4k
JSONPath example is invalid on Windows #9606
Copy link
Copy link
Closed
Description
This is a...
- Feature Request
- Bug Report
Problem:
The page https://kubernetes.io/docs/reference/kubectl/jsonpath/ gives the following as an example of JSONPath usage:
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}'`
When I paste this into a Windows command prompt, I get the error error: error parsing jsonpath '{range, unclosed action.
Proposed Solution:
On Windows, you need to use double quotes around JSONPaths with spaces in them. This in turn means you need to use a single quote or an escaped double quote around literals:
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}"
Page to Update:
https://kubernetes.io/docs/reference/kubectl/jsonpath/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels