mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to v0.8
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
17
vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider.go
generated
vendored
17
vendor/github.com/moby/buildkit/session/sshforward/sshprovider/agentprovider.go
generated
vendored
@ -6,6 +6,8 @@ import (
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/moby/buildkit/session"
|
||||
@ -139,7 +141,7 @@ func toAgentSource(paths []string) (source, error) {
|
||||
socket = p
|
||||
continue
|
||||
}
|
||||
keys = true
|
||||
|
||||
f, err := os.Open(p)
|
||||
if err != nil {
|
||||
return source{}, errors.Wrapf(err, "failed to open %s", p)
|
||||
@ -151,11 +153,24 @@ func toAgentSource(paths []string) (source, error) {
|
||||
|
||||
k, err := ssh.ParseRawPrivateKey(dt)
|
||||
if err != nil {
|
||||
// On Windows, os.ModeSocket isn't appropriately set on the file mode.
|
||||
// https://github.com/golang/go/issues/33357
|
||||
// If parsing the file fails, check to see if it kind of looks like socket-shaped.
|
||||
if runtime.GOOS == "windows" && strings.Contains(string(dt), "socket") {
|
||||
if keys {
|
||||
return source{}, errors.Errorf("invalid combination of keys and sockets")
|
||||
}
|
||||
socket = p
|
||||
continue
|
||||
}
|
||||
|
||||
return source{}, errors.Wrapf(err, "failed to parse %s", p) // TODO: prompt passphrase?
|
||||
}
|
||||
if err := a.Add(agent.AddedKey{PrivateKey: k}); err != nil {
|
||||
return source{}, errors.Wrapf(err, "failed to add %s to agent", p)
|
||||
}
|
||||
|
||||
keys = true
|
||||
}
|
||||
|
||||
if socket != "" {
|
||||
|
Reference in New Issue
Block a user