Splat doesn't work for array - yq
Describe the bug The splat operator doesn't work with arrays.
Version of yq: 4.12.0 Operating system: windows Installed via: binary release
Input Yaml example.yml:
spec: selector: matchLabels: app: myapp template: metadata: labels: app: myapp spec: containers: - name: myapp-frontend image: myrepo.azurecr.io/myapp-frontend:latest - name: myapp-backend image: myrepo.azurecr.io/myapp-backend:latest
works correctly using integer:
yq eval '.spec.template.spec.containers.image' ./example.yaml myrepo.azurecr.io/myapp-frontend:latest yq eval '.spec.template.spec.containers.image' ./example.yaml myrepo.azurecr.io/myapp-backend:latest
fails with error using splat:
yq eval '.spec.template.spec.containers[*].image' ./example.yaml Error: '' expects 2 args but there is 1
While the docs do show usage with '*', omitting that seems to work as expected. Closing.
I took a quick look and can't find it again. I'd cleared my browser history so that isn't of any use. I strongly suspect I was looking at v2, not the current version. If I run across it again I'll add a comment with details. Sorry for the false alarm.
- dlopen hook breaks objects that attempt to open dynamic libraries from their runpaths - libTAS
- Custom referrer snippet not working - koko-analytics
- Fix skip_dir documentation - D onedrive
- [question] use command dependencies for model creation - spotlight
- openj9 Valhalla LWVT: Flatten value type arrays Java
- nuclei [feature] Workflow to support tags based execution - Go
- Bug in jnp.take with negative indexing - Python jax