diff --git a/src/jobservice/job/impl/scan/all.go b/src/jobservice/job/impl/scan/all.go index 01761cec9..812ea0ac9 100644 --- a/src/jobservice/job/impl/scan/all.go +++ b/src/jobservice/job/impl/scan/all.go @@ -95,7 +95,7 @@ func (sa *All) Run(ctx job.Context, params job.Parameters) error { data, err := ioutil.ReadAll(resp.Body) if err != nil { logger.Errorf("Failed to read response, error: %v", err) - } else if resp.StatusCode != http.StatusOK { + } else if resp.StatusCode != http.StatusAccepted { logger.Errorf("Unexpected response code: %d, data: %v", resp.StatusCode, data) } resp.Body.Close() diff --git a/src/pkg/scan/event/init.go b/src/pkg/scan/event/init.go index 0e63fbc85..83deb9e84 100644 --- a/src/pkg/scan/event/init.go +++ b/src/pkg/scan/event/init.go @@ -26,5 +26,7 @@ func Init() { log.Debugf("Subscribe topic %s for cascade deletion of scan reports", model.DeleteImageTopic) err := notifier.Subscribe(model.DeleteImageTopic, NewOnDelImageHandler()) - log.Error(errors.Wrap(err, "register on delete image handler: init: scan")) + if err != nil { + log.Error(errors.Wrap(err, "register on delete image handler: init: scan")) + } }