Skip to content

Commit

Permalink
fix: fetch reports in inmemory for all namespaces
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Choudhary <[email protected]>
  • Loading branch information
vishal-chdhry committed Jun 13, 2024
1 parent 40a7fd2 commit 4d1bc6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/storage/inmemory/ephr.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (e *ephrdb) List(ctx context.Context, namespace string) ([]reportsv1.Epheme
res := make([]reportsv1.EphemeralReport, 0)

for k, v := range e.db {
if strings.HasPrefix(k, namespace) {
if namespace == "" || strings.HasPrefix(k, namespace) {
res = append(res, v)
klog.Infof("value found for prefix:%s, key:%s", namespace, k)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/inmemory/polr.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (p *polrdb) List(ctx context.Context, namespace string) ([]v1alpha2.PolicyR
res := make([]v1alpha2.PolicyReport, 0)

for k, v := range p.db {
if strings.HasPrefix(k, namespace) {
if namespace == "" || strings.HasPrefix(k, namespace) {
res = append(res, v)
klog.Infof("value found for prefix:%s, key:%s", namespace, k)
}
Expand Down

0 comments on commit 4d1bc6e

Please sign in to comment.