diff --git a/go.mod b/go.mod index c6b19533..69e3ffba 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/creack/pty v1.1.24 github.com/davecgh/go-spew v1.1.1 github.com/distribution/reference v0.6.0 - github.com/docker/cli v28.0.0-rc.1+incompatible + github.com/docker/cli v28.0.0-rc.2+incompatible github.com/docker/cli-docs-tool v0.9.0 github.com/docker/docker v28.0.0-rc.2+incompatible github.com/docker/go-units v0.5.0 diff --git a/go.sum b/go.sum index 41d07973..c8fabf8f 100644 --- a/go.sum +++ b/go.sum @@ -122,8 +122,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v28.0.0-rc.1+incompatible h1:4Xkn+JKnvVqDfyL/pZCWaPM9jzPtAJvNu7qKBkotv3I= -github.com/docker/cli v28.0.0-rc.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.0.0-rc.2+incompatible h1:2N1dpr3qtlJwIQpqXm7oNwWNAUGzpKlsCeJ32ejvpTk= +github.com/docker/cli v28.0.0-rc.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli-docs-tool v0.9.0 h1:CVwQbE+ZziwlPqrJ7LRyUF6GvCA+6gj7MTCsayaK9t0= github.com/docker/cli-docs-tool v0.9.0/go.mod h1:ClrwlNW+UioiRyH9GiAOe1o3J/TsY3Tr1ipoypjAUtc= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= diff --git a/vendor/github.com/docker/cli/cli/cobra.go b/vendor/github.com/docker/cli/cli/cobra.go index feab2b4a..e6bcc90f 100644 --- a/vendor/github.com/docker/cli/cli/cobra.go +++ b/vendor/github.com/docker/cli/cli/cobra.go @@ -518,4 +518,4 @@ Run '{{.CommandPath}} COMMAND --help' for more information on a command. ` const helpTemplate = ` -{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}` +{{- if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}` diff --git a/vendor/github.com/docker/cli/cli/connhelper/commandconn/commandconn.go b/vendor/github.com/docker/cli/cli/connhelper/commandconn/commandconn.go index cfc2b86a..c100b97e 100644 --- a/vendor/github.com/docker/cli/cli/connhelper/commandconn/commandconn.go +++ b/vendor/github.com/docker/cli/cli/connhelper/commandconn/commandconn.go @@ -33,18 +33,28 @@ import ( ) // New returns net.Conn -func New(_ context.Context, cmd string, args ...string) (net.Conn, error) { - var ( - c commandConn - err error - ) - c.cmd = exec.Command(cmd, args...) +func New(ctx context.Context, cmd string, args ...string) (net.Conn, error) { + // Don't kill the ssh process if the context is cancelled. Killing the + // ssh process causes an error when go's http.Client tries to reuse the + // net.Conn (commandConn). + // + // Not passing down the Context might seem counter-intuitive, but in this + // case, the lifetime of the process should be managed by the http.Client, + // not the caller's Context. + // + // Further details;; + // + // - https://github.com/docker/cli/pull/3900 + // - https://github.com/docker/compose/issues/9448#issuecomment-1264263721 + ctx = context.WithoutCancel(ctx) + c := commandConn{cmd: exec.CommandContext(ctx, cmd, args...)} // we assume that args never contains sensitive information logrus.Debugf("commandconn: starting %s with %v", cmd, args) c.cmd.Env = os.Environ() c.cmd.SysProcAttr = &syscall.SysProcAttr{} setPdeathsig(c.cmd) createSession(c.cmd) + var err error c.stdin, err = c.cmd.StdinPipe() if err != nil { return nil, err diff --git a/vendor/github.com/docker/cli/opts/mount.go b/vendor/github.com/docker/cli/opts/mount.go index 3a4ee31a..5e23a513 100644 --- a/vendor/github.com/docker/cli/opts/mount.go +++ b/vendor/github.com/docker/cli/opts/mount.go @@ -43,6 +43,13 @@ func (m *MountOpt) Set(value string) error { return mount.VolumeOptions } + imageOptions := func() *mounttypes.ImageOptions { + if mount.ImageOptions == nil { + mount.ImageOptions = new(mounttypes.ImageOptions) + } + return mount.ImageOptions + } + bindOptions := func() *mounttypes.BindOptions { if mount.BindOptions == nil { mount.BindOptions = new(mounttypes.BindOptions) @@ -147,6 +154,8 @@ func (m *MountOpt) Set(value string) error { volumeOptions().DriverConfig.Options = make(map[string]string) } setValueOnMap(volumeOptions().DriverConfig.Options, val) + case "image-subpath": + imageOptions().Subpath = val case "tmpfs-size": sizeBytes, err := units.RAMInBytes(val) if err != nil { @@ -175,6 +184,9 @@ func (m *MountOpt) Set(value string) error { if mount.VolumeOptions != nil && mount.Type != mounttypes.TypeVolume { return fmt.Errorf("cannot mix 'volume-*' options with mount type '%s'", mount.Type) } + if mount.ImageOptions != nil && mount.Type != mounttypes.TypeImage { + return fmt.Errorf("cannot mix 'image-*' options with mount type '%s'", mount.Type) + } if mount.BindOptions != nil && mount.Type != mounttypes.TypeBind { return fmt.Errorf("cannot mix 'bind-*' options with mount type '%s'", mount.Type) } diff --git a/vendor/modules.txt b/vendor/modules.txt index e4404929..6d82b395 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -229,7 +229,7 @@ github.com/davecgh/go-spew/spew # github.com/distribution/reference v0.6.0 ## explicit; go 1.20 github.com/distribution/reference -# github.com/docker/cli v28.0.0-rc.1+incompatible +# github.com/docker/cli v28.0.0-rc.2+incompatible ## explicit github.com/docker/cli/cli github.com/docker/cli/cli-plugins/hooks