github.com/quay/claircore@v1.5.28/indexer/controller/indexfinished.go (about) 1 package controller 2 3 import ( 4 "context" 5 "fmt" 6 7 "github.com/quay/zlog" 8 ) 9 10 // indexFinished is the terminal stateFunc. once it transitions the 11 // indexer to the IndexFinished state the indexer will no longer transition 12 // and return an IndexReport to the caller 13 func indexFinished(ctx context.Context, s *Controller) (State, error) { 14 s.report.Success = true 15 zlog.Info(ctx).Msg("finishing scan") 16 17 err := s.Store.SetIndexFinished(ctx, s.report, s.Vscnrs) 18 if err != nil { 19 return Terminal, fmt.Errorf("failed finish scan: %w", err) 20 } 21 22 zlog.Info(ctx).Msg("manifest successfully scanned") 23 return Terminal, nil 24 }