mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-12-26 16:39:07 +08:00
vendor: github.com/docker/docker v26.0.0-rc1
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
14
vendor/github.com/docker/cli/cli-plugins/socket/socket.go
generated
vendored
14
vendor/github.com/docker/cli/cli-plugins/socket/socket.go
generated
vendored
@@ -1,12 +1,12 @@
|
||||
package socket
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
|
||||
"github.com/docker/distribution/uuid"
|
||||
)
|
||||
|
||||
// EnvKey represents the well-known environment variable used to pass the plugin being
|
||||
@@ -17,7 +17,7 @@ const EnvKey = "DOCKER_CLI_PLUGIN_SOCKET"
|
||||
// and update the conn pointer, and returns the listener for the socket (which the caller
|
||||
// is responsible for closing when it's no longer needed).
|
||||
func SetupConn(conn **net.UnixConn) (*net.UnixListener, error) {
|
||||
listener, err := listen("docker_cli_" + uuid.Generate().String())
|
||||
listener, err := listen("docker_cli_" + randomID())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -27,6 +27,14 @@ func SetupConn(conn **net.UnixConn) (*net.UnixListener, error) {
|
||||
return listener, nil
|
||||
}
|
||||
|
||||
func randomID() string {
|
||||
b := make([]byte, 16)
|
||||
if _, err := rand.Read(b); err != nil {
|
||||
panic(err) // This shouldn't happen
|
||||
}
|
||||
return hex.EncodeToString(b)
|
||||
}
|
||||
|
||||
func accept(listener *net.UnixListener, conn **net.UnixConn) {
|
||||
go func() {
|
||||
for {
|
||||
|
||||
5
vendor/github.com/docker/cli/cli-plugins/socket/socket_nodarwin.go
generated
vendored
5
vendor/github.com/docker/cli/cli-plugins/socket/socket_nodarwin.go
generated
vendored
@@ -1,4 +1,4 @@
|
||||
//go:build !darwin
|
||||
//go:build !darwin && !openbsd
|
||||
|
||||
package socket
|
||||
|
||||
@@ -15,5 +15,6 @@ func listen(socketname string) (*net.UnixListener, error) {
|
||||
|
||||
func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
|
||||
// do nothing
|
||||
// while on darwin we would unlink here; on non-darwin the socket is abstract and not present on the filesystem
|
||||
// while on darwin and OpenBSD we would unlink here;
|
||||
// on non-darwin the socket is abstract and not present on the filesystem
|
||||
}
|
||||
|
||||
19
vendor/github.com/docker/cli/cli-plugins/socket/socket_openbsd.go
generated
vendored
Normal file
19
vendor/github.com/docker/cli/cli-plugins/socket/socket_openbsd.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package socket
|
||||
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func listen(socketname string) (*net.UnixListener, error) {
|
||||
return net.ListenUnix("unix", &net.UnixAddr{
|
||||
Name: filepath.Join(os.TempDir(), socketname),
|
||||
Net: "unix",
|
||||
})
|
||||
}
|
||||
|
||||
func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
|
||||
syscall.Unlink(listener.Addr().String())
|
||||
}
|
||||
14
vendor/github.com/docker/cli/cli/command/cli_options.go
generated
vendored
14
vendor/github.com/docker/cli/cli/command/cli_options.go
generated
vendored
@@ -11,19 +11,11 @@ import (
|
||||
"github.com/moby/term"
|
||||
)
|
||||
|
||||
// CLIOption applies a modification on a DockerCli.
|
||||
// CLIOption is a functional argument to apply options to a [DockerCli]. These
|
||||
// options can be passed to [NewDockerCli] to initialize a new CLI, or
|
||||
// applied with [DockerCli.Initialize] or [DockerCli.Apply].
|
||||
type CLIOption func(cli *DockerCli) error
|
||||
|
||||
// DockerCliOption applies a modification on a DockerCli.
|
||||
//
|
||||
// Deprecated: use [CLIOption] instead.
|
||||
type DockerCliOption = CLIOption
|
||||
|
||||
// InitializeOpt is the type of the functional options passed to DockerCli.Initialize
|
||||
//
|
||||
// Deprecated: use [CLIOption] instead.
|
||||
type InitializeOpt = CLIOption
|
||||
|
||||
// WithStandardStreams sets a cli in, out and err streams with the standard streams.
|
||||
func WithStandardStreams() CLIOption {
|
||||
return func(cli *DockerCli) error {
|
||||
|
||||
2
vendor/github.com/docker/cli/opts/mount.go
generated
vendored
2
vendor/github.com/docker/cli/opts/mount.go
generated
vendored
@@ -131,6 +131,8 @@ func (m *MountOpt) Set(value string) error {
|
||||
return fmt.Errorf("invalid value for %s: %s (must be \"enabled\", \"disabled\", \"writable\", or \"readonly\")",
|
||||
key, val)
|
||||
}
|
||||
case "volume-subpath":
|
||||
volumeOptions().Subpath = val
|
||||
case "volume-nocopy":
|
||||
volumeOptions().NoCopy, err = strconv.ParseBool(val)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user