Open rotty3000 opened 3 months ago
/sig api-machinery
/sig cli /cc @jpbetz /triage accepted
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.