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>
This commit is contained in:
baude
2019-06-24 15:48:34 -05:00
parent a1a4a75abe
commit dd81a44ccf
72 changed files with 822 additions and 746 deletions

View File

@ -4,7 +4,7 @@ package adapter
import (
iopodman "github.com/containers/libpod/cmd/podman/varlink"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/define"
"github.com/pkg/errors"
)
@ -21,11 +21,11 @@ func TranslateMapErrors(failures map[string]error) map[string]error {
func TranslateError(err error) error {
switch err.(type) {
case *iopodman.ContainerNotFound:
return errors.Wrap(libpod.ErrNoSuchCtr, err.Error())
return errors.Wrap(define.ErrNoSuchCtr, err.Error())
case *iopodman.ErrCtrStopped:
return errors.Wrap(libpod.ErrCtrStopped, err.Error())
return errors.Wrap(define.ErrCtrStopped, err.Error())
case *iopodman.InvalidState:
return errors.Wrap(libpod.ErrCtrStateInvalid, err.Error())
return errors.Wrap(define.ErrCtrStateInvalid, err.Error())
}
return err
}