As a user, I would like to be able to use JSONPath filters to recursively search for a particular value on yaml nodes that are not only limited to arrays/sequence nodes.
An example of this would be when a user would like to look up all instances of a value in a kubernetes manifest, so that all instances of that value can be replaced.
Consider the following query and Kubernetes manifest:
$..[?(@ == "dns-udp")]
---
apiVersion: v1
kind: Service
metadata:
name: bind-udp
namespace: tanzu-dns
labels:
app.kubernetes.io/name: external-dns
annotations:
# NOTE: this only works on 1.19.1+vmware.1+, but not prior
## This annotation will be ignored on other cloud providers
service.beta.kubernetes.io/aws-load-balancer-type: nlb
spec:
selector:
app.kubernetes.io/name: external-dns
type: LoadBalancer
ports:
- name: dns-udp
port: 53
protocol: UDP
targetPort: dns-udp
status: {}
I would like the yamlNodes returned which should contain the values:
As a user, I would like to be able to use JSONPath filters to recursively search for a particular value on yaml nodes that are not only limited to arrays/sequence nodes.
An example of this would be when a user would like to look up all instances of a value in a kubernetes manifest, so that all instances of that value can be replaced.
Consider the following query and Kubernetes manifest:
$..[?(@ == "dns-udp")]
I would like the yamlNodes returned which should contain the values: