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/util.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/util.go')
-rw-r--r-- | libpod/util.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libpod/util.go b/libpod/util.go index 3a15f9e39..7b3a03785 100644 --- a/libpod/util.go +++ b/libpod/util.go @@ -11,6 +11,7 @@ import ( "github.com/containers/image/signature" "github.com/containers/image/types" + "github.com/containers/libpod/libpod/define" "github.com/fsnotify/fsnotify" spec "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" @@ -126,7 +127,7 @@ func WaitForFile(path string, chWait chan error, timeout time.Duration) (bool, e return false, errors.Wrapf(err, "checking file %s", path) } case <-timeoutChan: - return false, errors.Wrapf(ErrInternal, "timed out waiting for file %s", path) + return false, errors.Wrapf(define.ErrInternal, "timed out waiting for file %s", path) } } } @@ -156,15 +157,15 @@ func sortMounts(m []spec.Mount) []spec.Mount { func validPodNSOption(p *Pod, ctrPod string) error { if p == nil { - return errors.Wrapf(ErrInvalidArg, "pod passed in was nil. Container may not be associated with a pod") + return errors.Wrapf(define.ErrInvalidArg, "pod passed in was nil. Container may not be associated with a pod") } if ctrPod == "" { - return errors.Wrapf(ErrInvalidArg, "container is not a member of any pod") + return errors.Wrapf(define.ErrInvalidArg, "container is not a member of any pod") } if ctrPod != p.ID() { - return errors.Wrapf(ErrInvalidArg, "pod passed in is not the pod the container is associated with") + return errors.Wrapf(define.ErrInvalidArg, "pod passed in is not the pod the container is associated with") } return nil } |