-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Jsonpath impl does not support left match regex #124157
Comments
fixes kubernetes#124157 Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
fixes kubernetes#124157 Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
fixes kubernetes#124157 Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
/sig api-machinery |
/sig cli |
I'll defer to sig-cli for the kubectl functionality, which I think is front and center here. But just to clarify the server side aspects-- on the apiserver we only use a very limited subset of json path, typically we only allow a dot separated list of field names like supported by CRD additionalPrinterColumns and similar. I don't anticipate that being expanded. We're trending toward use of CEL server side to perform more involved operations, including plans to use it for field extraction, and so I don't think we'll be investing in json path in the apiserver. |
What would you like to be added?
I would like to have support for
=~
in jsonpath filter expressions.e.g.
Matches a Golang regular expression. For example,
k get pods -o jsonpath='{.items[?(@.metadata.name =~ /^node.*/i)].metadata.name}'
matches items whose description starts with node (case-insensitive).Why is this needed?
When many resources exist in the system being able to match by regex can greatly simplify locating the desired resources.
Note: I am willing to contribute an implementation.
The text was updated successfully, but these errors were encountered: