diff --git a/src/controller/artifact/model.go b/src/controller/artifact/model.go index 0953fd0690f..6bf731dd754 100644 --- a/src/controller/artifact/model.go +++ b/src/controller/artifact/model.go @@ -80,6 +80,7 @@ func (artifact *Artifact) SetAdditionLink(addition, version string) { artifact.AdditionLinks[addition] = &AdditionLink{HREF: href, Absolute: false} } +// SetSBOMAdditionLink set the link of SBOM addition func (artifact *Artifact) SetSBOMAdditionLink(sbomDgst string, version string) { if artifact.AdditionLinks == nil { artifact.AdditionLinks = make(map[string]*AdditionLink) @@ -88,7 +89,7 @@ func (artifact *Artifact) SetSBOMAdditionLink(sbomDgst string, version string) { projectName, repo := utils.ParseRepository(artifact.RepositoryName) // encode slash as %252F 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} } diff --git a/src/pkg/scan/job.go b/src/pkg/scan/job.go index f0db850e627..e485a143dd1 100644 --- a/src/pkg/scan/job.go +++ b/src/pkg/scan/job.go @@ -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) 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 }