diff --git a/pkg/storage/inmemory/ephr.go b/pkg/storage/inmemory/ephr.go index 6e2fb46..9437a82 100644 --- a/pkg/storage/inmemory/ephr.go +++ b/pkg/storage/inmemory/ephr.go @@ -28,7 +28,7 @@ func (e *ephrdb) List(ctx context.Context, namespace string) ([]reportsv1.Epheme res := make([]reportsv1.EphemeralReport, 0) for _, k := range e.db.Keys() { - if strings.HasPrefix(k, fmt.Sprintf("ephr/%s/", namespace)) { + if namespace == "" || strings.HasPrefix(k, fmt.Sprintf("ephr/%s/", namespace)) { v, _ := e.db.Get(k) res = append(res, *v) klog.Infof("value found for prefix:%s, key:%s", namespace, k) diff --git a/pkg/storage/inmemory/polr.go b/pkg/storage/inmemory/polr.go index cd385d8..1ea6cb9 100644 --- a/pkg/storage/inmemory/polr.go +++ b/pkg/storage/inmemory/polr.go @@ -28,7 +28,7 @@ func (p *polrdb) List(ctx context.Context, namespace string) ([]v1alpha2.PolicyR res := make([]v1alpha2.PolicyReport, 0) for _, k := range p.db.Keys() { - if strings.HasPrefix(k, fmt.Sprintf("polr/%s/", namespace)) { + if namespace == "" || strings.HasPrefix(k, fmt.Sprintf("polr/%s/", namespace)) { klog.Infof("value found for prefix:%s, key:%s", namespace, k) v, err := p.db.Get(k) if err != nil {