Fix standalone pod crashing when checking for pod owner
What does this MR do and why?
Fix Operational container crashing when scanning a standalone pod.
How to set up and validate locally
-
Setup OCS locally
-
Create a standalone pod
kubectl run pingpong --image alpine:3.17.3 ping 1.1.1.1
-
Start an OCS scan in the default namespace
container_scanning: cadence: '00 * * * *' vulnerability_report: namespaces: - default - kube-system
- The scan should complete successfully without crashing
Linked issue Operational container scanning pod crashes when... (gitlab-org/gitlab#415140 - closed)
Edited by Shao Ming Tan