Skip to content

Commit

Permalink
build: add explicit failure if attestations are not supported on buil…
Browse files Browse the repository at this point in the history
…dkitd

Signed-off-by: Justin Chadwell <me@jedevc.com>
  • Loading branch information
jedevc committed Nov 24, 2022
1 parent 884ef62 commit 78fc5ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@ func toSolveOpt(ctx context.Context, di DriverInfo, multiDriver bool, opt Option
}
}

if len(opt.Attests) > 0 {
if !bopts.LLBCaps.Contains(apicaps.CapID("exporter.image.attestations")) {
return nil, nil, errors.Errorf("attestations are not supported by the current buildkitd")
}
}
for k, v := range opt.Attests {
so.FrontendAttrs[k] = v
}
Expand Down

0 comments on commit 78fc5ed

Please sign in to comment.