From e24c65d278b7f84a3d2947f7a73deeb1d3789710 Mon Sep 17 00:00:00 2001 From: Mark Frost Date: Wed, 21 Feb 2024 09:47:32 +0000 Subject: [PATCH] httptransport: 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 }