mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-16 08:27:06 +08:00
build: error on attests on non-multiplatform driver
On drivers that do not support multi-platform builds (the default `docker` driver), we do not support building attestations (unless using the containerd store). We need to check this feature before attempting to build using attestations. Also adds a test to ensure that attestations can be pushed to registries at all, and that it adequately fails on the docker driver. Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
@ -454,7 +454,7 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
|
||||
attests[k] = *v
|
||||
}
|
||||
}
|
||||
supportsAttestations := bopts.LLBCaps.Contains(apicaps.CapID("exporter.image.attestations"))
|
||||
supportsAttestations := bopts.LLBCaps.Contains(apicaps.CapID("exporter.image.attestations")) && nodeDriver.Features(ctx)[driver.MultiPlatform]
|
||||
if len(attests) > 0 {
|
||||
if !supportsAttestations {
|
||||
return nil, nil, errors.Errorf("attestations are not supported by the current buildkitd")
|
||||
|
Reference in New Issue
Block a user