mirror of https://github.com/docker/buildx.git
build: skip build ref and provenance metadata for subrequests
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
07a85a544b
commit
36cd88f8ca
|
@ -510,10 +510,12 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
||||||
for k, v := range printRes {
|
for k, v := range printRes {
|
||||||
rr.ExporterResponse[k] = string(v)
|
rr.ExporterResponse[k] = string(v)
|
||||||
}
|
}
|
||||||
rr.ExporterResponse["buildx.build.ref"] = buildRef
|
if opt.PrintFunc == nil {
|
||||||
if node.Driver.HistoryAPISupported(ctx) {
|
rr.ExporterResponse["buildx.build.ref"] = buildRef
|
||||||
if err := setRecordProvenance(ctx, c, rr, so.Ref, opt.ProvenanceResponseMode, pw); err != nil {
|
if node.Driver.HistoryAPISupported(ctx) {
|
||||||
return err
|
if err := setRecordProvenance(ctx, c, rr, so.Ref, opt.ProvenanceResponseMode, pw); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1271,6 +1271,6 @@ target "default" {}
|
||||||
}
|
}
|
||||||
var md mdT
|
var md mdT
|
||||||
require.NoError(t, json.Unmarshal(dt, &md), dt)
|
require.NoError(t, json.Unmarshal(dt, &md), dt)
|
||||||
require.NotEmpty(t, md.Default.BuildRef)
|
require.Empty(t, md.Default.BuildRef)
|
||||||
require.Len(t, md.Default.ResultJSON.Warnings, 3)
|
require.Len(t, md.Default.ResultJSON.Warnings, 3)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1228,7 +1228,7 @@ COPy --from=base \
|
||||||
}
|
}
|
||||||
var md mdT
|
var md mdT
|
||||||
require.NoError(t, json.Unmarshal(dt, &md), dt)
|
require.NoError(t, json.Unmarshal(dt, &md), dt)
|
||||||
require.NotEmpty(t, md.BuildRef)
|
require.Empty(t, md.BuildRef)
|
||||||
require.Len(t, md.ResultJSON.Warnings, 3)
|
require.Len(t, md.ResultJSON.Warnings, 3)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue