Merge pull request #1883 from tiborvass/bump-buildkit

vendor buildkit to f238f1e
This commit is contained in:
Sebastiaan van Stijn 2019-05-13 18:40:47 -07:00 committed by GitHub
commit 78e910caa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 { if len(options.secrets) > 0 {
sp, err := parseSecretSpecs(options.secrets) sp, err := parseSecretSpecs(options.secrets)
if err != nil { if err != nil {

View File

@ -51,7 +51,7 @@ github.com/Microsoft/go-winio 84b4ab48a50763fe7b3abcef38e5
github.com/Microsoft/hcsshim 672e52e9209d1e53718c1b6a7d68cc9272654ab5 github.com/Microsoft/hcsshim 672e52e9209d1e53718c1b6a7d68cc9272654ab5
github.com/miekg/pkcs11 6120d95c0e9576ccf4a78ba40855809dca31a9ed github.com/miekg/pkcs11 6120d95c0e9576ccf4a78ba40855809dca31a9ed
github.com/mitchellh/mapstructure f15292f7a699fcc1a38a80977f80a046874ba8ac 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/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3
github.com/modern-go/reflect2 4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd # 1.0.1 github.com/modern-go/reflect2 4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd # 1.0.1
github.com/morikuni/aec 39771216ff4c63d11f5e604076f9c45e8be1067b github.com/morikuni/aec 39771216ff4c63d11f5e604076f9c45e8be1067b

View File

@ -410,9 +410,6 @@ func parseCacheOptions(opt SolveOpt) (*cacheOptions, error) {
if csDir == "" { if csDir == "" {
return nil, errors.New("local cache importer requires src") 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) cs, err := contentlocal.NewStore(csDir)
if err != nil { if err != nil {
return nil, err 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) { 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{}) resp, err := c.Ping(ctx, &pb.PingRequest{})
if err != nil { if err != nil {
return nil, err return nil, err

View File

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

View File

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

View File

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