Skip to content

Commit

Permalink
Merge pull request #2572 from crazy-max/build-ref-multi-nodes
Browse files Browse the repository at this point in the history
build: set same ref when building on multiple nodes
  • Loading branch information
tonistiigi authored Jul 3, 2024
2 parents 5656c98 + 6fc19c4 commit 1ffc6f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/exporter/containerimage/exptypes"
gateway "github.com/moby/buildkit/frontend/gateway/client"
"github.com/moby/buildkit/identity"
"github.com/moby/buildkit/session"
"github.com/moby/buildkit/solver/errdefs"
"github.com/moby/buildkit/solver/pb"
Expand Down Expand Up @@ -216,6 +217,9 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
if err != nil {
logrus.WithError(err).Warn("current commit information was not captured by the build")
}
if opt.Ref == "" {
opt.Ref = identity.NewID()
}
var reqn []*reqForNode
for _, np := range drivers[k] {
if np.Node().Driver.IsMobyDriver() {
Expand Down
4 changes: 0 additions & 4 deletions build/opt.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
SourcePolicy: opt.SourcePolicy,
}

if so.Ref == "" {
so.Ref = identity.NewID()
}

if opt.CgroupParent != "" {
so.FrontendAttrs["cgroup-parent"] = opt.CgroupParent
}
Expand Down

0 comments on commit 1ffc6f1

Please sign in to comment.