mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 13:37:08 +08:00
vendor: github.com/docker/cli v28.0.0-rc.2
full diff: https://github.com/docker/cli/compare/v28.0.0-rc.1...v28.0.0-rc.2 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
2
vendor/github.com/docker/cli/cli/cobra.go
generated
vendored
2
vendor/github.com/docker/cli/cli/cobra.go
generated
vendored
@ -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}}`
|
||||
|
22
vendor/github.com/docker/cli/cli/connhelper/commandconn/commandconn.go
generated
vendored
22
vendor/github.com/docker/cli/cli/connhelper/commandconn/commandconn.go
generated
vendored
@ -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
|
||||
|
12
vendor/github.com/docker/cli/opts/mount.go
generated
vendored
12
vendor/github.com/docker/cli/opts/mount.go
generated
vendored
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user