Skip to content

Commit

Permalink
Add purl to SPDX go dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev>
  • Loading branch information
puerco committed Mar 29, 2022
1 parent 895cff9 commit 7517579
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/sbom/spdx.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ type tmplInfo struct {

// TODO: use k8s.io/release/pkg/bom
var tmpl = template.Must(template.New("").Funcs(template.FuncMap{
"dots": func(s string) string { return strings.ReplaceAll(s, "/", ".") },
"dots": func(s string) string { return strings.ReplaceAll(s, "/", ".") },
"bomRef": func(p, v string) string { return bomRef(p, v) },
"h1toSHA256": func(s string) (string, error) {
if !strings.HasPrefix(s, "h1:") {
return "", fmt.Errorf("malformed sum prefix: %q", s)
Expand Down Expand Up @@ -108,6 +109,7 @@ PackageLicenseDeclared: NOASSERTION
PackageCopyrightText: NOASSERTION
PackageLicenseComments: NOASSERTION
PackageComment: NOASSERTION
ExternalRef: PACKAGE-MANAGER purl {{ bomRef .Path .Version }}
{{ end }}
`))

0 comments on commit 7517579

Please sign in to comment.