Skip to content

Commit

Permalink
indexer: Reprocess unfinished index reports
Browse files Browse the repository at this point in the history
If a manifest has scanned with all it's scanners it _should_ end up with a completed index report in the IndexFinished state.  If it does not then it will not be possible to query this manifest.  To fix an incomplete index report it will need rescanning so trigger a rescan.

Signed-off-by: Iain Duncan <[email protected]>
  • Loading branch information
iainduncani committed Oct 31, 2023
1 parent af3cac9 commit 6e80b61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions indexer/controller/checkmanifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ func checkManifest(ctx context.Context, s *Controller) (State, error) {
return Terminal, fmt.Errorf("failed to retrieve manifest: %w", err)
}
s.report = sr
if sr.State != IndexFinished.String() {
// The manifest has been processed with all the Scanners but the index report did not end up in the IndexFinished state.
// This means that something must have gone wrong along the way so reprocess the manifest again.
// Do not do any filtering of the Vscnrs as we do not went wrong during the scanning process.
return FetchLayers, nil
}

return Terminal, nil
}

0 comments on commit 6e80b61

Please sign in to comment.