From dd81a44ccfa34585ef62319835c8bb421db9e334 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 24 Jun 2019 15:48:34 -0500 Subject: 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 --- libpod/runtime_cstorage.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libpod/runtime_cstorage.go') 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 { -- cgit v1.2.3-54-g00ecf