mirror of https://github.com/docker/buildx.git
Merge pull request #1612 from cpuguy83/env_no_provenance
Add env var to disable default attestations
This commit is contained in:
commit
1c6060f27d
|
@ -465,8 +465,19 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
|
|||
so.FrontendAttrs[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := opt.Attests["attest:provenance"]; !ok && supportsAttestations {
|
||||
so.FrontendAttrs["attest:provenance"] = "mode=min,inline-only=true"
|
||||
const noAttestEnv = "BUILDX_NO_DEFAULT_ATTESTATIONS"
|
||||
var noProv bool
|
||||
if v, ok := os.LookupEnv(noAttestEnv); ok {
|
||||
noProv, err = strconv.ParseBool(v)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "invalid "+noAttestEnv)
|
||||
}
|
||||
}
|
||||
if !noProv {
|
||||
so.FrontendAttrs["attest:provenance"] = "mode=min,inline-only=true"
|
||||
}
|
||||
}
|
||||
|
||||
switch len(opt.Exports) {
|
||||
|
|
Loading…
Reference in New Issue