Skip to content

Commit bcc8b87

Browse files
committed
fix: handle both build and bake attestation string conversion
Previously, bake would not have the `attest:` prefix but build would. In upstream the prefix is added late in the process for bake. This caused builds to add an additional attest: to their prefix. Signed-off-by: Chris Goller <[email protected]>
1 parent a7e804c commit bcc8b87

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/buildx/build/build.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
401401
supportsAttestations := true
402402
if len(attests) > 0 {
403403
for k, v := range attests {
404+
// DEPOT: Bake does not have `attest:` and build does.
405+
if !strings.HasPrefix(k, "attest:") {
406+
k = "attest:" + k
407+
}
404408
so.FrontendAttrs[k] = v
405409
}
406410
}

0 commit comments

Comments
 (0)