mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-24 19:25:19 +01:00
Change the log message when PostScan failed. (#20650)
fixes #20573 remove s from additions/sboms in the link Signed-off-by: stonezdj <stone.zhang@broadcom.com>
This commit is contained in:
parent
cc1acc3890
commit
f86f1cebc3
@ -80,6 +80,7 @@ func (artifact *Artifact) SetAdditionLink(addition, version string) {
|
|||||||
artifact.AdditionLinks[addition] = &AdditionLink{HREF: href, Absolute: false}
|
artifact.AdditionLinks[addition] = &AdditionLink{HREF: href, Absolute: false}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetSBOMAdditionLink set the link of SBOM addition
|
||||||
func (artifact *Artifact) SetSBOMAdditionLink(sbomDgst string, version string) {
|
func (artifact *Artifact) SetSBOMAdditionLink(sbomDgst string, version string) {
|
||||||
if artifact.AdditionLinks == nil {
|
if artifact.AdditionLinks == nil {
|
||||||
artifact.AdditionLinks = make(map[string]*AdditionLink)
|
artifact.AdditionLinks = make(map[string]*AdditionLink)
|
||||||
@ -88,7 +89,7 @@ func (artifact *Artifact) SetSBOMAdditionLink(sbomDgst string, version string) {
|
|||||||
projectName, repo := utils.ParseRepository(artifact.RepositoryName)
|
projectName, repo := utils.ParseRepository(artifact.RepositoryName)
|
||||||
// encode slash as %252F
|
// encode slash as %252F
|
||||||
repo = repository.Encode(repo)
|
repo = repository.Encode(repo)
|
||||||
href := fmt.Sprintf("/api/%s/projects/%s/repositories/%s/artifacts/%s/additions/%s", version, projectName, repo, sbomDgst, addition)
|
href := fmt.Sprintf("/api/%s/projects/%s/repositories/%s/artifacts/%s/additions/sbom", version, projectName, repo, sbomDgst)
|
||||||
|
|
||||||
artifact.AdditionLinks[addition] = &AdditionLink{HREF: href, Absolute: false}
|
artifact.AdditionLinks[addition] = &AdditionLink{HREF: href, Absolute: false}
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ func (j *Job) Run(ctx job.Context, params job.Parameters) error {
|
|||||||
|
|
||||||
reportData, err := handler.PostScan(ctx, req, rp, rawReports[i], startTime, robotAccount)
|
reportData, err := handler.PostScan(ctx, req, rp, rawReports[i], startTime, robotAccount)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
myLogger.Errorf("Failed to convert vulnerability data to new schema for report %s, error %v", rp.UUID, err)
|
myLogger.Errorf("handler failed at PostScan, report %s, error %v", rp.UUID, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user