Skip to content

Commit

Permalink
Fixed the probe panic issue
Browse files Browse the repository at this point in the history
Signed-off-by: Partik <[email protected]>
  • Loading branch information
partik03 committed Dec 23, 2023
1 parent d505441 commit 678a97b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion probe/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,11 @@ func getAnnotatedPods(c *k8s.Client, o Options, postureData map[string]string) (
if err != nil {
return nil, [][]string{}, err
}
data = append(data, []string{armoredPod.Namespace, mp[armoredPod.Namespace].NsPostureString, mp[armoredPod.Namespace].NsVisibilityString, armoredPod.Name, ""})
if _, exists := mp[armoredPod.Namespace]; !exists {
data = append(data, []string{armoredPod.Namespace, "", "", armoredPod.Name, ""})
} else {
data = append(data, []string{armoredPod.Namespace, mp[armoredPod.Namespace].NsPostureString, mp[armoredPod.Namespace].NsVisibilityString, armoredPod.Name, ""})
}
labels := getAnnotatedPodLabels(armoredPod.Labels)

for policyKey, policyValue := range policyMap {
Expand Down

0 comments on commit 678a97b

Please sign in to comment.