Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cherry-pick] Change the log message when PostScan failed. #20699

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/controller/artifact/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
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)
Expand All @@ -88,7 +89,7 @@
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)

Check warning on line 92 in src/controller/artifact/model.go

View check run for this annotation

Codecov / codecov/patch

src/controller/artifact/model.go#L92

Added line #L92 was not covered by tests

artifact.AdditionLinks[addition] = &AdditionLink{HREF: href, Absolute: false}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/scan/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@

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)

Check warning on line 307 in src/pkg/scan/job.go

View check run for this annotation

Codecov / codecov/patch

src/pkg/scan/job.go#L307

Added line #L307 was not covered by tests
return err
}

Expand Down
Loading