Hi all,
I have a need to use yq to get all docker image names present in all possible k8s yaml files, like those produced by helm
or kubectl kustomize
. Here is my current query. Just wondering if you think this is exhaustive, getting all possible docker image names that a set of k8s yaml files would reference. Thanks in advance for any revisions.
select(.kind | test("^(Pod|Deployment|StatefulSet|Job|DaemonSet|ReplicaSet|CronJob)$")) |
.spec.containers[]?.image,
.spec.initContainers[]?.image,
.spec.ephemeralContainers[]?.image
.spec.template.spec.containers[]?.image,
.spec.template.spec.initContainers[]?.image,
.spec.template.spec.ephemeralContainers[]?.image