Skip to content

Commit

Permalink
chore: improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
otms61 committed Apr 4, 2023
1 parent 798897f commit baad8bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ func tryReferrerFromSBOM(r io.Reader) (referrer, error) {
return referrer{}, fmt.Errorf("unsupported format: %s", format)
}

log.Logger.Infof("SBOM detected: %s", format)

targetDesc, err := remote.Head(repo)
if err != nil {
return referrer{}, fmt.Errorf("error getting descriptor: %w", err)
Expand Down Expand Up @@ -192,13 +194,15 @@ func tryReferrerFromVulnerability(r io.Reader) (referrer, error) {
repo, err := name.NewDigest(d.Scanner.Result.Metadata.RepoDigests[0])
if err != nil {
return referrer{}, fmt.Errorf("error creating new digest: %w", err)

}

targetDesc, err := remote.Head(repo)
if err != nil {
return referrer{}, fmt.Errorf("error fetching target descriptor: %w", err)
}

log.Logger.Infof("Cosign vulnerability data detected")

return referrer{
annotations: map[string]string{
annotationKeyDescription: "Vulnerability Scan Report",
Expand Down

0 comments on commit baad8bc

Please sign in to comment.