Skip to content

Commit

Permalink
result: change reason types to strings
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Chadwell <me@jedevc.com>
  • Loading branch information
jedevc committed Dec 16, 2022
1 parent 244caf6 commit 3bc2aa6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/attestations/sbom/sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func CreateSBOMScanner(ctx context.Context, resolver llb.ImageMetaResolver, scan
Kind: gatewaypb.AttestationKindBundle,
Ref: stsbom,
Metadata: map[string][]byte{
result.AttestationReasonKey: result.AttestationReasonSBOM,
result.AttestationReasonKey: []byte(result.AttestationReasonSBOM),
},
InToto: result.InTotoAttestation{
PredicateType: intoto.PredicateSPDX,
Expand Down
2 changes: 1 addition & 1 deletion solver/llbsolver/proc/provenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func ProvenanceProcessor(attrs map[string]string) llbsolver.Processor {
res.AddAttestation(p.ID, llbsolver.Attestation{
Kind: gatewaypb.AttestationKindInToto,
Metadata: map[string][]byte{
result.AttestationReasonKey: result.AttestationReasonProvenance,
result.AttestationReasonKey: []byte(result.AttestationReasonProvenance),
result.AttestationInlineOnlyKey: []byte(strconv.FormatBool(inlineOnly)),
},
InToto: result.InTotoAttestation{
Expand Down
6 changes: 3 additions & 3 deletions solver/result/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const (
AttestationInlineOnlyKey = "inline-only"
)

var (
AttestationReasonSBOM = []byte("sbom")
AttestationReasonProvenance = []byte("provenance")
const (
AttestationReasonSBOM = "sbom"
AttestationReasonProvenance = "provenance"
)

type Attestation[T any] struct {
Expand Down

0 comments on commit 3bc2aa6

Please sign in to comment.