File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
content/en/docs/reference/kubectl Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -103,12 +103,11 @@ kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.
103
103
JSONPath regular expressions are not supported. If you want to match using regular expressions, you can use a tool such as ` jq ` .
104
104
105
105
``` shell
106
- # kubectl does not suport regular expressions
106
+ # kubectl does not support regular expressions for JSONpath output
107
107
# The following command does not work
108
108
kubectl get pods -o jsonpath=' {.items[?(@.metadata.name=~/^test$/)].metadata.name}'
109
109
110
110
# The following command achieves the same result
111
111
kubectl get pods -o json | jq -r ' .items[] | select(.metadata.name | test("test-")).spec.containers[].image'
112
112
```
113
113
{{< /note >}}
114
-
You can’t perform that action at this time.
0 commit comments