summaryrefslogtreecommitdiff
path: root/daemon/attach.go
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2019-08-09 14:10:07 +0200
committerSebastiaan van Stijn <github@gone.nl>2020-04-14 17:22:23 +0200
commiteb14d936bfc296f0a85bf4dc9e9bb1f4b4a01282 (patch)
tree204ab64dee9afbdb84b461e2a9ee12db38bb0836 /daemon/attach.go
parent797ec8e91332ee9cc40724a322372624bb9df1e7 (diff)
downloaddocker-eb14d936bfc296f0a85bf4dc9e9bb1f4b4a01282.tar.gz
daemon: rename variables that collide with imported package names
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'daemon/attach.go')
-rw-r--r--daemon/attach.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/daemon/attach.go b/daemon/attach.go
index 0e12441ad1..7f81b6fec8 100644
--- a/daemon/attach.go
+++ b/daemon/attach.go
@@ -27,15 +27,15 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA
}
}
- container, err := daemon.GetContainer(prefixOrName)
+ ctr, err := daemon.GetContainer(prefixOrName)
if err != nil {
return err
}
- if container.IsPaused() {
+ if ctr.IsPaused() {
err := fmt.Errorf("container %s is paused, unpause the container before attach", prefixOrName)
return errdefs.Conflict(err)
}
- if container.IsRestarting() {
+ if ctr.IsRestarting() {
err := fmt.Errorf("container %s is restarting, wait until the container is running", prefixOrName)
return errdefs.Conflict(err)
}
@@ -44,11 +44,11 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA
UseStdin: c.UseStdin,
UseStdout: c.UseStdout,
UseStderr: c.UseStderr,
- TTY: container.Config.Tty,
- CloseStdin: container.Config.StdinOnce,
+ TTY: ctr.Config.Tty,
+ CloseStdin: ctr.Config.StdinOnce,
DetachKeys: keys,
}
- container.StreamConfig.AttachStreams(&cfg)
+ ctr.StreamConfig.AttachStreams(&cfg)
inStream, outStream, errStream, err := c.GetStreams()
if err != nil {
@@ -56,7 +56,7 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA
}
defer inStream.Close()
- if !container.Config.Tty && c.MuxStreams {
+ if !ctr.Config.Tty && c.MuxStreams {
errStream = stdcopy.NewStdWriter(errStream, stdcopy.Stderr)
outStream = stdcopy.NewStdWriter(outStream, stdcopy.Stdout)
}
@@ -71,7 +71,7 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA
cfg.Stderr = errStream
}
- if err := daemon.containerAttach(container, &cfg, c.Logs, c.Stream); err != nil {
+ if err := daemon.containerAttach(ctr, &cfg, c.Logs, c.Stream); err != nil {
fmt.Fprintf(outStream, "Error attaching: %s\n", err)
}
return nil
@@ -79,7 +79,7 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA
// ContainerAttachRaw attaches the provided streams to the container's stdio
func (daemon *Daemon) ContainerAttachRaw(prefixOrName string, stdin io.ReadCloser, stdout, stderr io.Writer, doStream bool, attached chan struct{}) error {
- container, err := daemon.GetContainer(prefixOrName)
+ ctr, err := daemon.GetContainer(prefixOrName)
if err != nil {
return err
}
@@ -87,10 +87,10 @@ func (daemon *Daemon) ContainerAttachRaw(prefixOrName string, stdin io.ReadClose
UseStdin: stdin != nil,
UseStdout: stdout != nil,
UseStderr: stderr != nil,
- TTY: container.Config.Tty,
- CloseStdin: container.Config.StdinOnce,
+ TTY: ctr.Config.Tty,
+ CloseStdin: ctr.Config.StdinOnce,
}
- container.StreamConfig.AttachStreams(&cfg)
+ ctr.StreamConfig.AttachStreams(&cfg)
close(attached)
if cfg.UseStdin {
cfg.Stdin = stdin
@@ -102,7 +102,7 @@ func (daemon *Daemon) ContainerAttachRaw(prefixOrName string, stdin io.ReadClose
cfg.Stderr = stderr
}
- return daemon.containerAttach(container, &cfg, false, doStream)
+ return daemon.containerAttach(ctr, &cfg, false, doStream)
}
func (daemon *Daemon) containerAttach(c *container.Container, cfg *stream.AttachConfig, logs, doStream bool) error {