New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to negate a jsonpath conditional #7853
Comments
/assign @steveperry-53 |
Looks like there are many variants of jsonpath implementation. The one kubectl is using is very basic one. Regarding the filtering function, you can find the implementation here: https://github.com/kubernetes/client-go/blob/master/util/jsonpath/parser.go#L339 So ... there is currently no support to logical negation. I'm not aware of any official standard saying that JsonPath is compatible to XPath. Maybe I'm wrong. |
When I search for "jsonpath", my first hit is http://goessner.net/articles/JsonPath/. I guess it doesn't quite state that JsonPath is compatible with XPath, but it frequently references XPath and doesn't have a full reference of its own (e.g. it doesn't even mention
Could the jsonpath docs include a link to whichever standard this is, or its own documentation if Thanks for the link to the source! |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale I think my above comment still stands:
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten
Does anyone know what "original JSONPath syntax" refers to? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This is a...
Problem:
lists namespaces that have the label "origin". How do I list namespaces that don't have the label "origin"?
The
jsonpath
docs provided by kubernetes.io are very sparse, and pretty much say "we support jsonpath plus a few extra features". There's no link to the official "jsonpath" docs, so I had to search and eventually found my way to http://goessner.net/articles/JsonPath/. That pretty much says "jsonpath is like xpath" without giving a full description of the syntax, so I then found my way to https://en.wikipedia.org/wiki/XPath.That finally seemed to be comprehensive syntax documentation, yet doesn't seem compatible with k8s. For my above example, I would expect the boolean function
not
to work, yetfails with
error: error parsing jsonpath {range .items[?(not(@.metadata.labels.origin))]}{.metadata.name}{"\n"}, unclosed array expect ]
.Proposed Solution:
Include full jsonpath syntax documentation, or link to a page that documents jsonpath in a way that is compatible with
k8s
. Alternately, ifkubectl
does not really support jsonpath, the line "And we add three functions in addition to the original JSONPath syntax" should be changed to reflect that.Page to Update:
https://kubernetes.io/docs/reference/kubectl/jsonpath/
The text was updated successfully, but these errors were encountered: