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/runtime_cstorage.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/runtime_cstorage.go')
-rw-r--r-- | libpod/runtime_cstorage.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libpod/runtime_cstorage.go b/libpod/runtime_cstorage.go index 569f63322..586db5a1e 100644 --- a/libpod/runtime_cstorage.go +++ b/libpod/runtime_cstorage.go @@ -1,6 +1,7 @@ package libpod import ( + "github.com/containers/libpod/libpod/define" "github.com/containers/storage" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -56,7 +57,7 @@ func (r *Runtime) RemoveStorageContainer(idOrName string, force bool) error { targetID, err := r.store.Lookup(idOrName) if err != nil { if err == storage.ErrLayerUnknown { - return errors.Wrapf(ErrNoSuchCtr, "no container with ID or name %q found", idOrName) + return errors.Wrapf(define.ErrNoSuchCtr, "no container with ID or name %q found", idOrName) } return errors.Wrapf(err, "error looking up container %q", idOrName) } @@ -66,7 +67,7 @@ func (r *Runtime) RemoveStorageContainer(idOrName string, force bool) error { ctr, err := r.store.Container(targetID) if err != nil { if err == storage.ErrContainerUnknown { - return errors.Wrapf(ErrNoSuchCtr, "%q does not refer to a container", idOrName) + return errors.Wrapf(define.ErrNoSuchCtr, "%q does not refer to a container", idOrName) } return errors.Wrapf(err, "error retrieving container %q", idOrName) } @@ -77,7 +78,7 @@ func (r *Runtime) RemoveStorageContainer(idOrName string, force bool) error { return err } if exists { - return errors.Wrapf(ErrCtrExists, "refusing to remove %q as it exists in libpod as container %s", idOrName, ctr.ID) + return errors.Wrapf(define.ErrCtrExists, "refusing to remove %q as it exists in libpod as container %s", idOrName, ctr.ID) } if !force { @@ -92,7 +93,7 @@ func (r *Runtime) RemoveStorageContainer(idOrName string, force bool) error { return errors.Wrapf(err, "error looking up container %q mounts", idOrName) } if timesMounted > 0 { - return errors.Wrapf(ErrCtrStateInvalid, "container %q is mounted and cannot be removed without using force", idOrName) + return errors.Wrapf(define.ErrCtrStateInvalid, "container %q is mounted and cannot be removed without using force", idOrName) } } else { if _, err := r.store.Unmount(ctr.ID, true); err != nil { |