vendor: update buildkit to f238f1e

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2019-05-14 17:37:34 -07:00
parent cb83df7a69
commit b68b005f68
170 changed files with 14083 additions and 4723 deletions

View File

@ -2,7 +2,8 @@ package authprovider
import (
"context"
"io/ioutil"
"io"
"sync"
"github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/configfile"
@ -11,14 +12,20 @@ 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),
}
}
type authProvider struct {
config *configfile.ConfigFile
// The need for this mutex is not well understood.
// Without it, the docker cli on OS X hangs when
// reading credentials from docker-credential-osxkeychain.
// See issue https://github.com/docker/cli/issues/1862
mu sync.Mutex
}
func (ap *authProvider) Register(server *grpc.Server) {
@ -26,6 +33,8 @@ func (ap *authProvider) Register(server *grpc.Server) {
}
func (ap *authProvider) Credentials(ctx context.Context, req *auth.CredentialsRequest) (*auth.CredentialsResponse, error) {
ap.mu.Lock()
defer ap.mu.Unlock()
if req.Host == "registry-1.docker.io" {
req.Host = "https://index.docker.io/v1/"
}