diff --git a/src/common/dao/scan_job.go b/src/common/dao/scan_job.go index 099964953..d3bf1c982 100644 --- a/src/common/dao/scan_job.go +++ b/src/common/dao/scan_job.go @@ -147,8 +147,8 @@ func UpdateImgScanOverview(digest, detailsKey string, sev models.Severity, compO rec.DetailsKey = detailsKey rec.UpdateTime = time.Now() - n, err := o.Update(rec, "Sev", "CompOverviewStr", "DetailsKey", "UpdateTime") - if n == 0 || err != nil { + _, err = o.Update(rec, "Sev", "CompOverviewStr", "DetailsKey", "UpdateTime") + if err != nil { return fmt.Errorf("Failed to update scan overview record with digest: %s, error: %v", digest, err) } return nil diff --git a/src/jobservice/scan/handlers.go b/src/jobservice/scan/handlers.go index 6c788a66b..0850ce6c8 100644 --- a/src/jobservice/scan/handlers.go +++ b/src/jobservice/scan/handlers.go @@ -135,7 +135,7 @@ func (sh *SummarizeHandler) Enter() (string, error) { layerName := sh.Context.layers[len(sh.Context.layers)-1].Name logger.Infof("Top layer's name: %s, will use it to get the vulnerability result of image", layerName) if err := clair.UpdateScanOverview(sh.Context.Digest, layerName); err != nil { - return "", nil + return "", err } return models.JobFinished, nil }