Skip to content

Commit

Permalink
feat: fix listing in inmemory
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 4, 2024
1 parent b709483 commit da73ac7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ kind-install: $(HELM) kind-load ## Build image, load it in kind cluster and depl
--set image.repository=$(PACKAGE) \
--set image.tag=$(GIT_SHA)

.PHONY: kind-install-inmemory
kind-install-inmemory: $(HELM) kind-load ## Build image, load it in kind cluster and deploy helm chart
@echo Install chart... >&2
@$(HELM) upgrade --install reports-server --namespace reports-server --create-namespace --wait ./charts/reports-server \
--set image.registry=$(KO_REGISTRY) \
--set config.debug=true \
--set postgresql.enabled=false \
--set image.repository=$(PACKAGE) \
--set image.tag=$(GIT_SHA)

########
# HELP #
########
Expand Down
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 strings.HasPrefix(k, fmt.Sprintf("ephr/%s/", 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 strings.HasPrefix(k, fmt.Sprintf("polr/%s/", namespace)) {
res = append(res, v)
klog.Infof("value found for prefix:%s, key:%s", namespace, k)
}
Expand Down

0 comments on commit da73ac7

Please sign in to comment.