Skip to content

Commit

Permalink
fix: update native scanner to check for running pods only
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 ce3549a commit 1a5460a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/pkg/k8s/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ func determineUnprotectedPods(clientset *kubernetes.Clientset, nsName string, co
}

for _, pod := range allPods.Items {
if pod.Status.Phase != v1.PodRunning {
continue
}
if !coveredPods[pod.Name] {
podDetail := fmt.Sprintf("%s %s %s", nsName, pod.Name, pod.Status.PodIP)
if !containsPodDetail(scanResult.UnprotectedPods, podDetail) {
Expand Down

0 comments on commit 1a5460a

Please sign in to comment.