From 5bf85e1a3e1c5c170769e50326e4575d765244b4 Mon Sep 17 00:00:00 2001 From: Mark Frost Date: Tue, 20 Feb 2024 11:58:08 +0000 Subject: [PATCH] address review comments Signed-off-by: Mark Frost --- httptransport/matcher_v1.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/httptransport/matcher_v1.go b/httptransport/matcher_v1.go index b23c0046f0..1efde13074 100644 --- a/httptransport/matcher_v1.go +++ b/httptransport/matcher_v1.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/quay/claircore" - indexerController "github.com/quay/claircore/indexer/controller" + "github.com/quay/claircore/indexer/controller" "github.com/quay/claircore/libvuln/driver" "github.com/quay/zlog" oteltrace "go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace" @@ -127,7 +127,9 @@ func (h *MatcherV1) vulnerabilityReport(w http.ResponseWriter, r *http.Request) apiError(ctx, w, http.StatusInternalServerError, "experienced a server side error: %v", err) } // now check present and finished only after confirming no err - if !ok || indexReport.State != indexerController.IndexFinished.String() { + var indexState controller.State + indexState.FromString(indexReport.State) + if !ok || indexState != controller.IndexFinished { apiError(ctx, w, http.StatusNotFound, "index report for manifest %q not found", manifest.String()) return }