From baad8bc3f0aa6bb2081aeefe51a480ec67c14ba0 Mon Sep 17 00:00:00 2001 From: Akira Saso Date: Wed, 5 Apr 2023 01:21:42 +0900 Subject: [PATCH] chore: improve logs --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index d8aeebe..20f084a 100644 --- a/main.go +++ b/main.go @@ -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) @@ -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",