diff options
author | baude <bbaude@redhat.com> | 2019-06-24 15:48:34 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-06-25 13:51:24 -0500 |
commit | dd81a44ccfa34585ef62319835c8bb421db9e334 (patch) | |
tree | 7bab006a56d5823ccdf7b8cf6e59502ee954a979 /libpod/container_attach_linux.go | |
parent | a1a4a75abee2c381483a218e1660621ee416ef7c (diff) | |
download | podman-dd81a44ccfa34585ef62319835c8bb421db9e334.tar.gz podman-dd81a44ccfa34585ef62319835c8bb421db9e334.tar.bz2 podman-dd81a44ccfa34585ef62319835c8bb421db9e334.zip |
remove libpod from main
the compilation demands of having libpod in main is a burden for the
remote client compilations. to combat this, we should move the use of
libpod structs, vars, constants, and functions into the adapter code
where it will only be compiled by the local client.
this should result in cleaner code organization and smaller binaries. it
should also help if we ever need to compile the remote client on
non-Linux operating systems natively (not cross-compiled).
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/container_attach_linux.go')
-rw-r--r-- | libpod/container_attach_linux.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libpod/container_attach_linux.go b/libpod/container_attach_linux.go index 7e9b7697b..5293480f0 100644 --- a/libpod/container_attach_linux.go +++ b/libpod/container_attach_linux.go @@ -10,6 +10,7 @@ import ( "path/filepath" "sync" + "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/kubeutils" "github.com/containers/libpod/utils" "github.com/docker/docker/pkg/term" @@ -34,7 +35,7 @@ const ( // Does not check if state is appropriate func (c *Container) attach(streams *AttachStreams, keys string, resize <-chan remotecommand.TerminalSize, startContainer bool, wg *sync.WaitGroup) error { if !streams.AttachOutput && !streams.AttachError && !streams.AttachInput { - return errors.Wrapf(ErrInvalidArg, "must provide at least one stream to attach to") + return errors.Wrapf(define.ErrInvalidArg, "must provide at least one stream to attach to") } // Check the validity of the provided keys first @@ -57,7 +58,7 @@ func (c *Container) attach(streams *AttachStreams, keys string, resize <-chan re // TODO add a channel to allow interrupting func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSize, detachKeys []byte, streams *AttachStreams, startContainer bool, wg *sync.WaitGroup) error { if startContainer && wg == nil { - return errors.Wrapf(ErrInternal, "wait group not passed when startContainer set") + return errors.Wrapf(define.ErrInternal, "wait group not passed when startContainer set") } kubeutils.HandleResizing(resize, func(size remotecommand.TerminalSize) { @@ -118,7 +119,7 @@ func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSi case err := <-receiveStdoutError: return err case err := <-stdinDone: - if err == ErrDetach { + if err == define.ErrDetach { return err } if streams.AttachOutput || streams.AttachError { |