vendor buildkit to f238f1e

Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Tibor Vass 2019-05-14 01:24:27 +00:00
parent a77e3af471
commit 529ef6e89a
7 changed files with 15 additions and 8 deletions

View File

@ -174,7 +174,7 @@ func runBuildBuildKit(dockerCli command.Cli, options buildOptions) error {
}))
}
s.Allow(authprovider.NewDockerAuthProvider())
s.Allow(authprovider.NewDockerAuthProvider(os.Stderr))
if len(options.secrets) > 0 {
sp, err := parseSecretSpecs(options.secrets)
if err != nil {

View File

@ -51,7 +51,7 @@ github.com/Microsoft/go-winio 84b4ab48a50763fe7b3abcef38e5
github.com/Microsoft/hcsshim 672e52e9209d1e53718c1b6a7d68cc9272654ab5
github.com/miekg/pkcs11 6120d95c0e9576ccf4a78ba40855809dca31a9ed
github.com/mitchellh/mapstructure f15292f7a699fcc1a38a80977f80a046874ba8ac
github.com/moby/buildkit 646fc0af6d283397b9e47cd0a18779e9d0376e0e # v0.5.1
github.com/moby/buildkit f238f1efb04f00bf0cc147141fda9ddb55c8bc49
github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3
github.com/modern-go/reflect2 4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd # 1.0.1
github.com/morikuni/aec 39771216ff4c63d11f5e604076f9c45e8be1067b

View File

@ -410,9 +410,6 @@ func parseCacheOptions(opt SolveOpt) (*cacheOptions, error) {
if csDir == "" {
return nil, errors.New("local cache importer requires src")
}
if err := os.MkdirAll(csDir, 0755); err != nil {
return nil, err
}
cs, err := contentlocal.NewStore(csDir)
if err != nil {
return nil, err

View File

@ -28,6 +28,8 @@ type GrpcClient interface {
}
func New(ctx context.Context, opts map[string]string, session, product string, c pb.LLBBridgeClient, w []client.WorkerInfo) (GrpcClient, error) {
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
resp, err := c.Ping(ctx, &pb.PingRequest{})
if err != nil {
return nil, err

View File

@ -2,7 +2,7 @@ package authprovider
import (
"context"
"io/ioutil"
"io"
"sync"
"github.com/docker/cli/cli/config"
@ -12,9 +12,9 @@ import (
"google.golang.org/grpc"
)
func NewDockerAuthProvider() session.Attachable {
func NewDockerAuthProvider(stderr io.Writer) session.Attachable {
return &authProvider{
config: config.LoadDefaultConfigFile(ioutil.Discard),
config: config.LoadDefaultConfigFile(stderr),
}
}

View File

@ -46,6 +46,7 @@ type conn struct {
closedOnce sync.Once
readMu sync.Mutex
writeMu sync.Mutex
err error
closeCh chan struct{}
}
@ -79,6 +80,8 @@ func (c *conn) Read(b []byte) (n int, err error) {
}
func (c *conn) Write(b []byte) (int, error) {
c.writeMu.Lock()
defer c.writeMu.Unlock()
m := &controlapi.BytesMessage{Data: b}
if err := c.stream.SendMsg(m); err != nil {
return 0, err
@ -93,7 +96,9 @@ func (c *conn) Close() (err error) {
}()
if cs, ok := c.stream.(grpc.ClientStream); ok {
c.writeMu.Lock()
err = cs.CloseSend()
c.writeMu.Unlock()
if err != nil {
return
}
@ -106,6 +111,7 @@ func (c *conn) Close() (err error) {
err = c.stream.RecvMsg(m)
if err != nil {
if err != io.EOF {
c.readMu.Unlock()
return
}
err = nil

View File

@ -162,7 +162,9 @@ func (sm *Manager) Get(ctx context.Context, id string) (Caller, error) {
go func() {
select {
case <-ctx.Done():
sm.mu.Lock()
sm.updateCondition.Broadcast()
sm.mu.Unlock()
}
}()