A pending pod will not have any containerStatuses as the container has yet to be deployed and this line of code errors with jq: error (at <stdin>:5): Cannot iterate over null (null) on any pod with a pending status (in my case because I purposefully made the pod schedulable) on my nodes. Adding the ? will have jq skip over instances that do not have results.
A pending pod will not have any containerStatuses as the container has yet to be deployed and this line of code errors with
jq: error (at <stdin>:5): Cannot iterate over null (null)
on any pod with a pending status (in my case because I purposefully made the pod schedulable) on my nodes. Adding the ? will have jq skip over instances that do not have results.