Skip to content

Commit 0ddf801

Browse files
jedevctonistiigi
authored andcommitted
exporter: fix supplement sboms on empty scratch layer
Signed-off-by: Justin Chadwell <[email protected]> (cherry picked from commit f3db114)
1 parent 2120078 commit 0ddf801

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

exporter/containerimage/attestations.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ var intotoPlatform ocispecs.Platform = ocispecs.Platform{
3131

3232
// supplementSBOM modifies SPDX attestations to include the file layers
3333
func supplementSBOM(ctx context.Context, s session.Group, target cache.ImmutableRef, targetRemote *solver.Remote, att exporter.Attestation) (exporter.Attestation, error) {
34+
if target == nil {
35+
return att, nil
36+
}
3437
if att.Kind != gatewaypb.AttestationKindInToto {
3538
return att, nil
3639
}

0 commit comments

Comments
 (0)