Skip to content

Commit

Permalink
fix: ensure namespace exists before adding to inventory report
Browse files Browse the repository at this point in the history
Signed-off-by: Bradley Jones <[email protected]>
  • Loading branch information
bradleyjones committed May 16, 2024
1 parent 02ebaf5 commit fb751fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/inventory/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ func FetchNamespaces(
// Only return namespaces that are explicitly included if set
if len(includes) > 0 {
for _, ns := range includes {
nsList = append(nsList, nsMap[ns])
if _, exists := nsMap[ns]; exists {
nsList = append(nsList, nsMap[ns])
}
}
return nsList, nil
}
Expand Down

0 comments on commit fb751fa

Please sign in to comment.