Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

[18.09] builder: set externalkey option for faster hook processing #123

Merged
merged 2 commits into from
Nov 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions builder/builder-next/executor_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/moby/buildkit/solver/pb"
"github.com/moby/buildkit/util/network"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
)

const networkName = "bridge"
Expand Down Expand Up @@ -63,13 +64,13 @@ func (iface *lnInterface) init(c libnetwork.NetworkController, n libnetwork.Netw
defer close(iface.ready)
id := identity.NewID()

ep, err := n.CreateEndpoint(id)
ep, err := n.CreateEndpoint(id, libnetwork.CreateOptionDisableResolution())
if err != nil {
iface.err = err
return
}

sbx, err := c.NewSandbox(id)
sbx, err := c.NewSandbox(id, libnetwork.OptionUseExternalKey())
if err != nil {
iface.err = err
return
Expand Down Expand Up @@ -100,10 +101,10 @@ func (iface *lnInterface) Set(s *specs.Spec) {

func (iface *lnInterface) Close() error {
<-iface.ready
err := iface.sbx.Delete()
if iface.err != nil {
// iface.err takes precedence over cleanup errors
return iface.err
}
return err
go func() {
if err := iface.sbx.Delete(); err != nil {
logrus.Errorf("failed to delete builder network sandbox: %v", err)
}
}()
return iface.err
}