You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Use double quotes to quote text inside JSONPath expressions.
32
32
2. Use the `range`, `end` operators to iterate lists.
33
-
3. Use negative slice indices to step backwards through a list. Negative indices do not "wrap around" a list and are valid as long as `-index + listLength >= 0`.
33
+
3. Use negative slice indices to step backwards through a list. Negative indices do not "wrap around" a list and are valid as long as `-index + listLength >= 0`.
Examples using `kubectl` and JSONPath expressions:
120
+
<!--
121
+
Examples using `kubectl` and JSONPath expressions:
122
122
-->
123
123
使用 `kubectl` 和 JSONPath 表达式的示例:
124
124
@@ -131,7 +131,7 @@ kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'status.capacity']}"
131
131
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}'
132
132
```
133
133
134
-
<!--
134
+
<!--
135
135
{{< note >}}
136
136
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:
137
137
@@ -142,7 +142,7 @@ kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.
142
142
{{< /note >}}
143
143
-->
144
144
{{< note >}}
145
-
在 Windows 上,您必须用双引号把任何包含空格的 JSONPath 模板(不是上面 bash 所示的单引号)。
145
+
在 Windows 上,对于任何包含空格的 JSONPath 模板,您必须使用双引号(不是上面 bash 所示的单引号)。
146
146
反过来,这意味着您必须在模板中的所有文字周围使用单引号或转义的双引号。
147
147
例如:
148
148
@@ -176,4 +176,3 @@ kubectl get pods -o jsonpath='{.items[?(@.metadata.name=~/^test$/)].metadata.nam
0 commit comments