diff options
Diffstat (limited to 'pkg/varlinkapi/attach.go')
-rw-r--r-- | pkg/varlinkapi/attach.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/varlinkapi/attach.go b/pkg/varlinkapi/attach.go index 8051f07be..afa88e6a3 100644 --- a/pkg/varlinkapi/attach.go +++ b/pkg/varlinkapi/attach.go @@ -8,6 +8,7 @@ import ( "github.com/containers/libpod/cmd/podman/varlink" "github.com/containers/libpod/libpod" + "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/varlinkapi/virtwriter" "github.com/sirupsen/logrus" "k8s.io/client-go/tools/remotecommand" @@ -57,7 +58,7 @@ func (i *LibpodAPI) Attach(call iopodman.VarlinkCall, name string, detachKeys st if err != nil { return call.ReplyErrorOccurred(err.Error()) } - if !start && state != libpod.ContainerStateRunning { + if !start && state != define.ContainerStateRunning { return call.ReplyErrorOccurred("container must be running to attach") } @@ -72,13 +73,13 @@ func (i *LibpodAPI) Attach(call iopodman.VarlinkCall, name string, detachKeys st } }() - if state == libpod.ContainerStateRunning { + if state == define.ContainerStateRunning { finalErr = attach(ctr, streams, detachKeys, resize, errChan) } else { finalErr = startAndAttach(ctr, streams, detachKeys, resize, errChan) } - if finalErr != libpod.ErrDetach && finalErr != nil { + if finalErr != define.ErrDetach && finalErr != nil { logrus.Error(finalErr) } quitWriter := virtwriter.NewVirtWriteCloser(writer, virtwriter.Quit) |