JSONPaths with spaces must be double-quoted on Windows (#9679)
This commit is contained in:
parent
493caa56a9
commit
e03f1b4a52
|
|
@ -73,3 +73,10 @@ $ kubectl get pods -o=jsonpath='{.items[0]}'
|
|||
$ kubectl get pods -o=jsonpath='{.items[0].metadata.name}'
|
||||
$ kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}'
|
||||
```
|
||||
|
||||
On Windows, you must _double_ quote any JSONPath template that contains spaces (not single quote as shown above for bash). This in turn means that you must use a single quote or escaped double quote around any literals in the template. For example:
|
||||
|
||||
```cmd
|
||||
C:\> kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.status.startTime}{'\n'}{end}"
|
||||
C:\> kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.startTime}{\"\n\"}{end}"
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in New Issue