summaryrefslogtreecommitdiff
path: root/libpod/storage.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/storage.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/storage.go')
-rw-r--r--libpod/storage.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/libpod/storage.go b/libpod/storage.go
index 1a7b13da6..0814672be 100644
--- a/libpod/storage.go
+++ b/libpod/storage.go
@@ -6,9 +6,10 @@ import (
istorage "github.com/containers/image/storage"
"github.com/containers/image/types"
+ "github.com/containers/libpod/libpod/define"
"github.com/containers/storage"
"github.com/opencontainers/image-spec/specs-go/v1"
- opentracing "github.com/opentracing/opentracing-go"
+ "github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@@ -71,7 +72,7 @@ func (r *storageService) CreateContainerStorage(ctx context.Context, systemConte
if imageName != "" {
var ref types.ImageReference
if containerName == "" {
- return ContainerInfo{}, ErrEmptyID
+ return ContainerInfo{}, define.ErrEmptyID
}
// Check if we have the specified image.
ref, err := istorage.Transport.ParseStoreReference(r.store, imageID)
@@ -175,7 +176,7 @@ func (r *storageService) CreateContainerStorage(ctx context.Context, systemConte
func (r *storageService) DeleteContainer(idOrName string) error {
if idOrName == "" {
- return ErrEmptyID
+ return define.ErrEmptyID
}
container, err := r.store.Container(idOrName)
if err != nil {
@@ -214,7 +215,7 @@ func (r *storageService) MountContainerImage(idOrName string) (string, error) {
container, err := r.store.Container(idOrName)
if err != nil {
if errors.Cause(err) == storage.ErrContainerUnknown {
- return "", ErrNoSuchCtr
+ return "", define.ErrNoSuchCtr
}
return "", err
}
@@ -233,7 +234,7 @@ func (r *storageService) MountContainerImage(idOrName string) (string, error) {
func (r *storageService) UnmountContainerImage(idOrName string, force bool) (bool, error) {
if idOrName == "" {
- return false, ErrEmptyID
+ return false, define.ErrEmptyID
}
container, err := r.store.Container(idOrName)
if err != nil {
@@ -260,7 +261,7 @@ func (r *storageService) UnmountContainerImage(idOrName string, force bool) (boo
func (r *storageService) MountedContainerImage(idOrName string) (int, error) {
if idOrName == "" {
- return 0, ErrEmptyID
+ return 0, define.ErrEmptyID
}
container, err := r.store.Container(idOrName)
if err != nil {
@@ -277,7 +278,7 @@ func (r *storageService) GetMountpoint(id string) (string, error) {
container, err := r.store.Container(id)
if err != nil {
if errors.Cause(err) == storage.ErrContainerUnknown {
- return "", ErrNoSuchCtr
+ return "", define.ErrNoSuchCtr
}
return "", err
}
@@ -293,7 +294,7 @@ func (r *storageService) GetWorkDir(id string) (string, error) {
container, err := r.store.Container(id)
if err != nil {
if errors.Cause(err) == storage.ErrContainerUnknown {
- return "", ErrNoSuchCtr
+ return "", define.ErrNoSuchCtr
}
return "", err
}
@@ -304,7 +305,7 @@ func (r *storageService) GetRunDir(id string) (string, error) {
container, err := r.store.Container(id)
if err != nil {
if errors.Cause(err) == storage.ErrContainerUnknown {
- return "", ErrNoSuchCtr
+ return "", define.ErrNoSuchCtr
}
return "", err
}