mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-19 17:58:04 +08:00
build: set record provenance in response
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -79,11 +79,12 @@ type Options struct {
|
||||
Target string
|
||||
Ulimits *opts.UlimitOpt
|
||||
|
||||
Session []session.Attachable
|
||||
Linked bool // Linked marks this target as exclusively linked (not requested by the user).
|
||||
PrintFunc *PrintFunc
|
||||
SourcePolicy *spb.Policy
|
||||
GroupRef string
|
||||
Session []session.Attachable
|
||||
Linked bool // Linked marks this target as exclusively linked (not requested by the user).
|
||||
PrintFunc *PrintFunc
|
||||
WithProvenanceResponse bool
|
||||
SourcePolicy *spb.Policy
|
||||
GroupRef string
|
||||
}
|
||||
|
||||
type PrintFunc struct {
|
||||
@@ -488,6 +489,11 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
||||
rr.ExporterResponse[k] = string(v)
|
||||
}
|
||||
rr.ExporterResponse["buildx.build.ref"] = buildRef
|
||||
if opt.WithProvenanceResponse && node.Driver.HistoryAPISupported(ctx) {
|
||||
if err := setRecordProvenance(ctx, c, rr, so.Ref, pw); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
node := dp.Node().Driver
|
||||
if node.IsMobyDriver() {
|
||||
|
Reference in New Issue
Block a user