vendor: docker/cli v29.3.0, moby/api v1.54.0, moby/client v0.3.0
This also allows the client to connect with API v1.40 and up (Docker 19.03), which previously was API v1.43 and up (Docker 25.0 and up). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ func (pl *PluginServer) Addr() net.Addr {
|
||||
// Close ensures that the server is no longer accepting new connections and
|
||||
// closes all existing connections. Existing connections will receive [io.EOF].
|
||||
//
|
||||
// The error value is that of the underlying [net.Listner.Close] call.
|
||||
// The error value is that of the underlying [net.Listener.Close] call.
|
||||
func (pl *PluginServer) Close() error {
|
||||
if pl == nil {
|
||||
return nil
|
||||
|
||||
+2
-3
@@ -6,6 +6,7 @@ package command
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"maps"
|
||||
|
||||
"github.com/docker/cli/cli/context/store"
|
||||
)
|
||||
@@ -23,9 +24,7 @@ func (dc DockerContext) MarshalJSON() ([]byte, error) {
|
||||
s["Description"] = dc.Description
|
||||
}
|
||||
if dc.AdditionalFields != nil {
|
||||
for k, v := range dc.AdditionalFields {
|
||||
s[k] = v
|
||||
}
|
||||
maps.Copy(s, dc.AdditionalFields)
|
||||
}
|
||||
return json.Marshal(s)
|
||||
}
|
||||
|
||||
+1
-1
@@ -350,7 +350,7 @@ func DisplayablePorts(ports []container.PortSummary) string {
|
||||
last uint16
|
||||
}
|
||||
groupMap := make(map[string]*portGroup)
|
||||
var result []string //nolint:prealloc
|
||||
var result []string
|
||||
var hostMappings []string
|
||||
var groupMapKeys []string
|
||||
sort.Slice(ports, func(i, j int) bool {
|
||||
|
||||
+2
-2
@@ -144,8 +144,8 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword
|
||||
}
|
||||
}
|
||||
|
||||
argPassword = strings.TrimSpace(argPassword)
|
||||
if argPassword == "" {
|
||||
isEmpty := strings.TrimSpace(argPassword) == ""
|
||||
if isEmpty {
|
||||
restoreInput, err := prompt.DisableInputEcho(cli.In())
|
||||
if err != nil {
|
||||
return registrytypes.AuthConfig{}, err
|
||||
|
||||
+3
-3
@@ -155,11 +155,11 @@ func (e statusError) Error() string {
|
||||
// Note: The root command's name is excluded. If cmd is the root cmd, return ""
|
||||
func getCommandName(cmd *cobra.Command) string {
|
||||
fullCmdName := getFullCommandName(cmd)
|
||||
i := strings.Index(fullCmdName, " ")
|
||||
if i == -1 {
|
||||
_, after, ok := strings.Cut(fullCmdName, " ")
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
return fullCmdName[i+1:]
|
||||
return after
|
||||
}
|
||||
|
||||
// getFullCommandName gets the full cobra command name in the format
|
||||
|
||||
+5
-3
@@ -1,3 +1,6 @@
|
||||
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
|
||||
//go:build go1.24
|
||||
|
||||
package configfile
|
||||
|
||||
import (
|
||||
@@ -6,6 +9,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -374,9 +378,7 @@ func getConfiguredCredentialStore(c *ConfigFile, registryHostname string) string
|
||||
func (configFile *ConfigFile) GetAllCredentials() (map[string]types.AuthConfig, error) {
|
||||
auths := make(map[string]types.AuthConfig)
|
||||
addAll := func(from map[string]types.AuthConfig) {
|
||||
for reg, ac := range from {
|
||||
auths[reg] = ac
|
||||
}
|
||||
maps.Copy(auths, from)
|
||||
}
|
||||
|
||||
defaultStore := configFile.GetCredentialsStore("")
|
||||
|
||||
+6
-4
@@ -1,3 +1,6 @@
|
||||
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
|
||||
//go:build go1.24
|
||||
|
||||
// Package connhelper provides helpers for connecting to a remote daemon host with custom logic.
|
||||
package connhelper
|
||||
|
||||
@@ -6,6 +9,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/cli/cli/connhelper/commandconn"
|
||||
@@ -89,10 +93,8 @@ func addSSHTimeout(sshFlags []string) []string {
|
||||
// disablePseudoTerminalAllocation disables pseudo-terminal allocation to
|
||||
// prevent SSH from executing as a login shell
|
||||
func disablePseudoTerminalAllocation(sshFlags []string) []string {
|
||||
for _, flag := range sshFlags {
|
||||
if flag == "-T" {
|
||||
return sshFlags
|
||||
}
|
||||
if slices.Contains(sshFlags, "-T") {
|
||||
return sshFlags
|
||||
}
|
||||
return append(sshFlags, "-T")
|
||||
}
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ func quoteCommand(commandAndArgs ...string) (string, error) {
|
||||
quotedCmd = a
|
||||
continue
|
||||
}
|
||||
quotedCmd += " " + a //nolint:perfsprint // ignore "concat-loop"; no need to use a string-builder for this.
|
||||
quotedCmd += " " + a
|
||||
}
|
||||
// each part is quoted appropriately, so now we'll have a full
|
||||
// shell command to pass off to "ssh"
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ func (*GpuOpts) Type() string {
|
||||
|
||||
// String returns a string repr of this option
|
||||
func (o *GpuOpts) String() string {
|
||||
gpus := []string{}
|
||||
gpus := make([]string, 0, len(o.values))
|
||||
for _, gpu := range o.values {
|
||||
gpus = append(gpus, fmt.Sprintf("%v", gpu))
|
||||
}
|
||||
|
||||
+7
-2
@@ -57,7 +57,7 @@ func (m *MountOpt) Set(value string) error {
|
||||
|
||||
if !hasValue {
|
||||
switch key {
|
||||
case "readonly", "ro", "volume-nocopy", "bind-nonrecursive":
|
||||
case "readonly", "ro", "volume-nocopy", "bind-nonrecursive", "bind-create-src":
|
||||
// boolean values
|
||||
default:
|
||||
return fmt.Errorf("invalid field '%s' must be a key=value pair", field)
|
||||
@@ -102,6 +102,11 @@ func (m *MountOpt) Set(value string) error {
|
||||
default:
|
||||
return fmt.Errorf(`invalid value for %s: %s (must be "enabled", "disabled", "writable", or "readonly")`, key, val)
|
||||
}
|
||||
case "bind-create-src":
|
||||
ensureBindOptions(&mount).CreateMountpoint, err = parseBoolValue(key, val, hasValue)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
case "volume-subpath":
|
||||
ensureVolumeOptions(&mount).Subpath = val
|
||||
case "volume-nocopy":
|
||||
@@ -151,7 +156,7 @@ func (*MountOpt) Type() string {
|
||||
|
||||
// String returns a string repr of this option
|
||||
func (m *MountOpt) String() string {
|
||||
mounts := []string{}
|
||||
mounts := make([]string, 0, len(m.values))
|
||||
for _, mount := range m.values {
|
||||
repr := fmt.Sprintf("%s %s %s", mount.Type, mount.Source, mount.Target)
|
||||
mounts = append(mounts, repr)
|
||||
|
||||
+5
-6
@@ -1,3 +1,6 @@
|
||||
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
|
||||
//go:build go1.24
|
||||
|
||||
package opts
|
||||
|
||||
import (
|
||||
@@ -7,6 +10,7 @@ import (
|
||||
"math/big"
|
||||
"net"
|
||||
"path"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/cli/internal/lazyregexp"
|
||||
@@ -104,12 +108,7 @@ func (opts *ListOpts) GetAllOrEmpty() []string {
|
||||
|
||||
// Get checks the existence of the specified key.
|
||||
func (opts *ListOpts) Get(key string) bool {
|
||||
for _, k := range *opts.values {
|
||||
if k == key {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(*opts.values, key)
|
||||
}
|
||||
|
||||
// Len returns the amount of element in the slice.
|
||||
|
||||
Reference in New Issue
Block a user