Commit Graph

15 Commits

Author SHA1 Message Date
acejilam
a8fc969a34 Fix: null jsonpath serialization
Signed-off-by: acejilam <acejilam@gmail.com>

Kubernetes-commit: 9646ae5a9efb0eee7ac15577d113699700233017
2023-08-10 19:32:47 +08:00
Wojciech Tyczyński
a806c6e4fd Remove selflink references in different testing-related files
Kubernetes-commit: 551790729f1d26d75c1d3fa1411e341eb367f9f3
2022-01-13 11:33:26 +01:00
atiratree
e529a15dbc add a test for jsonpath template parsing to prevent regressions
This behaviour was broken by commit
39cfe232325d66bcdbc935af7aaf7022562e7010 and PR kubernetes#98057

Kubernetes-commit: b79859cb12b19222fffc17481e1fe006819de63c
2021-08-26 14:49:58 +02:00
atiratree
496c390182 revert "fix wrong output when using jsonpath"
This partially reverts commit 39cfe232325d66bcdbc935af7aaf7022562e7010and PR #98057

the original problem was caused by not using {end} at the end of the range

Kubernetes-commit: 5c3de9f1de913d1251ce2183991a845edc01d123
2021-08-05 18:39:43 +02:00
Robin Černín
b6d16d4e18 [jsonpath] fix wrong output when using jsonpath
Fix range loop when using jsonpath

Without patch:

kubectl get -n openshift-oauth-apiserver po -o jsonpath='{range .items[?(.status.phase=="Running")]}{.metadata.name}{" is Running\n"}'
apiserver-7d9cc97649-79c2x is Running
apiserver-7d9cc97649-lgks6 is Running
apiserver-7d9cc97649-qgkxn is Running
 is Running

With patch:

kubectl get -n openshift-oauth-apiserver po -o jsonpath='{range .items[?(.status.phase=="Running")]}{.metadata.name}{" is Running\n"}'
apiserver-7d9cc97649-79c2x is Running
apiserver-7d9cc97649-lgks6 is Running
apiserver-7d9cc97649-qgkxn is Running

Kubernetes-commit: 39cfe232325d66bcdbc935af7aaf7022562e7010
2021-01-14 19:53:59 +10:00
brianpursley
135cef183c Fix bug in JSON path parser where an error occurs when a range is empty
Kubernetes-commit: 10634c6093c84acc78181a26c93d8785e12802e4
2020-11-01 10:41:19 -05:00
Joel Smith
2221ace373 jsonpath: disallow multiple immediate recursive descent (e.g. ....Foo)
Kubernetes-commit: 8c702254938c40a48b2e3db78fcc944ca50fdc65
2020-07-30 10:53:12 -06:00
Phil Ferrell
bd76c10336 client-go: change jsonpath output of non-primitive types from Go-syntax to JSON
kubectl: add --output jsonpath-as-json to print a json array of results
kubeadm: fix test case using jsonpath result of non-primitive type

Kubernetes-commit: ba386aba4fe02906089ca3e96ee07925bced5d4d
2020-04-15 14:45:44 -07:00
Brian Pursley
1ade84933e Fixed bug where jsonpath expression with a nested range does not process subsequent nodes
Kubernetes-commit: 852e661f3dd0f7be9b9b1469316d9947c4b5a5c0
2020-02-27 11:03:27 -05:00
Jordan Liggitt
6b7e2becf2 Fix jsonpath slice step handling
Kubernetes-commit: 233d7e4962f61e9e8b4a4695f0cdab688ffc4368
2019-01-21 16:58:52 -05:00
WanLinghao
4b473f5dc7 fix a client-go bug which could casue kubectl panic (#72952)
* When user try execute command like `kubectl get pod test -o custom-columns=CONTAINER:.spec.containers[-1].name`
It will throw a panic about slice index out of bounds. This patch fix it.

* add test case

Kubernetes-commit: 1e245fad87584a28809f8f5d380b766edfa984ec
2019-01-19 08:14:20 +08:00
Di Xu
d39d12f4b0 fix all the typos across the project
Kubernetes-commit: 48388fec7eaad4ac8d84fbe20673ffacf41964a1
2018-02-09 14:53:53 +08:00
Andy Goldstein
75943a8927 jsonpath filter: allow intermediate missing keys
In jsonpath, when filtering a list, if allowMissingKeys is true, skip
over any items that are missing an intermediate key in the filter,
instead of returning a confusing error.

For example, if the filter is

{.items[?(@.metadata.annotations.foo=="bar")].metadata.name}

we should return all items where metadata.annotations.foo == bar, but if
an item in the list does not have metadata, metadata.annotations, or
metadata.annotations.foo, skip it instead of erroring.

Kubernetes-commit: e6f97d514d83fc2614d1ad4e18de0b318cc81653
2017-07-16 03:58:42 +00:00
Chao Xu
088dc4a30d manually sync with k8s.io/kubernetest at 17375fc59fff39135af63bd1750bb07c36ef873b, k8s.io/apimachinery at d90aa2c8531f13b0ca734845934c10dcb6a56ca7 2017-02-23 12:27:32 -08:00
Kubernetes Publisher
fcdf37233b published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is baaaf26609565b4299008018486ec75fb30903eb
2017-01-25 15:19:43 +00:00