mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
Merge pull request #3030 from reasonerjt/fix-jobservice-update-vuln-bug
Do not throw error if the scan result is unchanged
This commit is contained in:
commit
1403fe09ff
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user