summaryrefslogtreecommitdiff
path: root/libpod/runtime_volume.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-06-24 15:48:34 -0500
committerbaude <bbaude@redhat.com>2019-06-25 13:51:24 -0500
commitdd81a44ccfa34585ef62319835c8bb421db9e334 (patch)
tree7bab006a56d5823ccdf7b8cf6e59502ee954a979 /libpod/runtime_volume.go
parenta1a4a75abee2c381483a218e1660621ee416ef7c (diff)
downloadpodman-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_volume.go')
-rw-r--r--libpod/runtime_volume.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/libpod/runtime_volume.go b/libpod/runtime_volume.go
index 68c6c107e..5c087faca 100644
--- a/libpod/runtime_volume.go
+++ b/libpod/runtime_volume.go
@@ -4,6 +4,7 @@ import (
"context"
"strings"
+ "github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/libpod/events"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@@ -26,7 +27,7 @@ func (r *Runtime) RemoveVolume(ctx context.Context, v *Volume, force bool) error
defer r.lock.Unlock()
if !r.valid {
- return ErrRuntimeStopped
+ return define.ErrRuntimeStopped
}
if !v.valid {
@@ -77,7 +78,7 @@ func (r *Runtime) GetVolume(name string) (*Volume, error) {
defer r.lock.RUnlock()
if !r.valid {
- return nil, ErrRuntimeStopped
+ return nil, define.ErrRuntimeStopped
}
vol, err := r.state.Volume(name)
@@ -103,7 +104,7 @@ func (r *Runtime) HasVolume(name string) (bool, error) {
defer r.lock.RUnlock()
if !r.valid {
- return false, ErrRuntimeStopped
+ return false, define.ErrRuntimeStopped
}
return r.state.HasVolume(name)
@@ -118,7 +119,7 @@ func (r *Runtime) Volumes(filters ...VolumeFilter) ([]*Volume, error) {
defer r.lock.RUnlock()
if !r.valid {
- return nil, ErrRuntimeStopped
+ return nil, define.ErrRuntimeStopped
}
vols, err := r.state.AllVolumes()
@@ -147,7 +148,7 @@ func (r *Runtime) GetAllVolumes() ([]*Volume, error) {
defer r.lock.RUnlock()
if !r.valid {
- return nil, ErrRuntimeStopped
+ return nil, define.ErrRuntimeStopped
}
return r.state.AllVolumes()
@@ -167,7 +168,7 @@ func (r *Runtime) PruneVolumes(ctx context.Context) ([]string, []error) {
for _, vol := range vols {
if err := r.RemoveVolume(ctx, vol, false); err != nil {
- if errors.Cause(err) != ErrVolumeBeingUsed && errors.Cause(err) != ErrVolumeRemoved {
+ if errors.Cause(err) != define.ErrVolumeBeingUsed && errors.Cause(err) != define.ErrVolumeRemoved {
pruneErrors = append(pruneErrors, err)
}
continue