Merge pull request #9634 from steven-zou/fix/#9632_and_#9633

fix bug found in the pluggable scanner
This commit is contained in:
Steven Zou 2019-10-29 17:36:19 +08:00 committed by GitHub
commit adf780c2a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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()

View File

@ -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"))
}
}