mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00
build: set same ref when building on multiple nodes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
5656c98133
commit
6fc19c4024
@ -32,6 +32,7 @@ import (
|
|||||||
"github.com/moby/buildkit/client/llb"
|
"github.com/moby/buildkit/client/llb"
|
||||||
"github.com/moby/buildkit/exporter/containerimage/exptypes"
|
"github.com/moby/buildkit/exporter/containerimage/exptypes"
|
||||||
gateway "github.com/moby/buildkit/frontend/gateway/client"
|
gateway "github.com/moby/buildkit/frontend/gateway/client"
|
||||||
|
"github.com/moby/buildkit/identity"
|
||||||
"github.com/moby/buildkit/session"
|
"github.com/moby/buildkit/session"
|
||||||
"github.com/moby/buildkit/solver/errdefs"
|
"github.com/moby/buildkit/solver/errdefs"
|
||||||
"github.com/moby/buildkit/solver/pb"
|
"github.com/moby/buildkit/solver/pb"
|
||||||
@ -216,6 +217,9 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Warn("current commit information was not captured by the build")
|
logrus.WithError(err).Warn("current commit information was not captured by the build")
|
||||||
}
|
}
|
||||||
|
if opt.Ref == "" {
|
||||||
|
opt.Ref = identity.NewID()
|
||||||
|
}
|
||||||
var reqn []*reqForNode
|
var reqn []*reqForNode
|
||||||
for _, np := range drivers[k] {
|
for _, np := range drivers[k] {
|
||||||
if np.Node().Driver.IsMobyDriver() {
|
if np.Node().Driver.IsMobyDriver() {
|
||||||
|
@ -104,10 +104,6 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
|
|||||||
SourcePolicy: opt.SourcePolicy,
|
SourcePolicy: opt.SourcePolicy,
|
||||||
}
|
}
|
||||||
|
|
||||||
if so.Ref == "" {
|
|
||||||
so.Ref = identity.NewID()
|
|
||||||
}
|
|
||||||
|
|
||||||
if opt.CgroupParent != "" {
|
if opt.CgroupParent != "" {
|
||||||
so.FrontendAttrs["cgroup-parent"] = opt.CgroupParent
|
so.FrontendAttrs["cgroup-parent"] = opt.CgroupParent
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user