Skip to content

Commit

Permalink
fix: update cilium scanners to only check running pods
Browse files Browse the repository at this point in the history
Signed-off-by: deggja <[email protected]>
  • Loading branch information
deggja committed Jun 23, 2024
1 parent 1a5460a commit 9e19faf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/pkg/k8s/cilium-scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ func determinePodCoverage(clientset *kubernetes.Clientset, nsName string, polici
}

for _, pod := range pods.Items {
if pod.Status.Phase != corev1.PodRunning {
continue
}
podIdentifier := fmt.Sprintf("%s/%s", pod.Namespace, pod.Name)
if _, exists := globallyProtectedPods[podIdentifier]; !exists {
if !IsPodProtected(writer, clientset, pod, policies, hasDenyAll, globallyProtectedPods) {
Expand Down

0 comments on commit 9e19faf

Please sign in to comment.