File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
content/en/docs/reference/kubectl Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -101,15 +101,14 @@ kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.
101
101
{{< note >}}
102
102
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
- Example currently not supported
105
104
106
105
``` shell
107
106
# kubectl does not suport regular expressions
108
107
# The following command does not work
109
- kubectl get secrets -o jsonpath=' {.items[?(@.metadata.name=~/^test$/)].metadata.name}'
108
+ kubectl get pods -o jsonpath=' {.items[?(@.metadata.name=~/^test$/)].metadata.name}'
110
109
111
110
# The following command achieves the same result
112
- kubectl get secrets -o json | jq ' [needs actual example code writing before merge] '
111
+ kubectl get pods -o json | jq -r ' .items[] | select(.metadata.name | test("test-")).spec.containers[].image '
113
112
```
114
113
{{< /note >}}
115
114
You can’t perform that action at this time.
0 commit comments