Skip to content

Commit c6df986

Browse files
frostmarcrozzy
authored andcommitted
httptransport: GET vuln report returns 404 when indexing in-progress
Signed-off-by: Mark Frost <[email protected]>
1 parent e5a896c commit c6df986

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

httptransport/matcher_v1.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/google/uuid"
1313
"github.com/ldelossa/responserecorder"
1414
"github.com/quay/claircore"
15+
indexerController "github.com/quay/claircore/indexer/controller"
1516
"github.com/quay/claircore/libvuln/driver"
1617
"github.com/quay/zlog"
1718
oteltrace "go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace"
@@ -119,8 +120,8 @@ func (h *MatcherV1) vulnerabilityReport(w http.ResponseWriter, r *http.Request)
119120
apiError(ctx, w, http.StatusInternalServerError, "experienced a server side error: %v", err)
120121
return
121122
}
122-
// now check bool only after confirming no err
123-
if !ok {
123+
// now check present and finished only after confirming no err
124+
if !ok || indexReport.State != indexerController.IndexFinished.String() {
124125
apiError(ctx, w, http.StatusNotFound, "index report for manifest %q not found", manifest.String())
125126
return
126127
}

0 commit comments

Comments
 (0)