Skip to content

Commit b79345c

Browse files
authored
Merge pull request #1645 from cpuguy83/0.10_env_no_provenance
[0.10] Add env var to disable default attestations
2 parents 79e156b + 23eb3c3 commit b79345c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

build/build.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,19 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
465465
so.FrontendAttrs[k] = v
466466
}
467467
}
468+
468469
if _, ok := opt.Attests["attest:provenance"]; !ok && supportsAttestations {
469-
so.FrontendAttrs["attest:provenance"] = "mode=min,inline-only=true"
470+
const noAttestEnv = "BUILDX_NO_DEFAULT_ATTESTATIONS"
471+
var noProv bool
472+
if v, ok := os.LookupEnv(noAttestEnv); ok {
473+
noProv, err = strconv.ParseBool(v)
474+
if err != nil {
475+
return nil, nil, errors.Wrap(err, "invalid "+noAttestEnv)
476+
}
477+
}
478+
if !noProv {
479+
so.FrontendAttrs["attest:provenance"] = "mode=min,inline-only=true"
480+
}
470481
}
471482

472483
switch len(opt.Exports) {

0 commit comments

Comments
 (0)