diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-06-26 02:36:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-26 02:36:06 +0200 |
commit | c9078936dd1bf5bdb59066eb1bdd179ac58f98e1 (patch) | |
tree | a8d769074e3ba43e100341c974639166c46ca5eb /libpod/runtime_pod_linux.go | |
parent | fbf5e80337c6399aa54c8ea1bc316eddb369ab0b (diff) | |
parent | dd81a44ccfa34585ef62319835c8bb421db9e334 (diff) | |
download | podman-c9078936dd1bf5bdb59066eb1bdd179ac58f98e1.tar.gz podman-c9078936dd1bf5bdb59066eb1bdd179ac58f98e1.tar.bz2 podman-c9078936dd1bf5bdb59066eb1bdd179ac58f98e1.zip |
Merge pull request #3419 from baude/removelibpodfrommainphase1
remove libpod from main
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r-- | libpod/runtime_pod_linux.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index 124d0daf8..d1d303ad5 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/containerd/cgroups" + "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/libpod/events" spec "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" @@ -22,7 +23,7 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (*Pod, defer r.lock.Unlock() if !r.valid { - return nil, ErrRuntimeStopped + return nil, define.ErrRuntimeStopped } pod, err := newPod(r) @@ -66,7 +67,7 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (*Pod, if pod.config.CgroupParent == "" { pod.config.CgroupParent = CgroupfsDefaultCgroupParent } else if strings.HasSuffix(path.Base(pod.config.CgroupParent), ".slice") { - return nil, errors.Wrapf(ErrInvalidArg, "systemd slice received as cgroup parent when using cgroupfs") + return nil, errors.Wrapf(define.ErrInvalidArg, "systemd slice received as cgroup parent when using cgroupfs") } // If we are set to use pod cgroups, set the cgroup parent that // all containers in the pod will share @@ -79,7 +80,7 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (*Pod, if pod.config.CgroupParent == "" { pod.config.CgroupParent = SystemdDefaultCgroupParent } else if len(pod.config.CgroupParent) < 6 || !strings.HasSuffix(path.Base(pod.config.CgroupParent), ".slice") { - return nil, errors.Wrapf(ErrInvalidArg, "did not receive systemd slice as cgroup parent when using systemd to manage cgroups") + return nil, errors.Wrapf(define.ErrInvalidArg, "did not receive systemd slice as cgroup parent when using systemd to manage cgroups") } // If we are set to use pod cgroups, set the cgroup parent that // all containers in the pod will share @@ -91,7 +92,7 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (*Pod, pod.state.CgroupPath = cgroupPath } default: - return nil, errors.Wrapf(ErrInvalidArg, "unsupported CGroup manager: %s - cannot validate cgroup parent", r.config.CgroupManager) + return nil, errors.Wrapf(define.ErrInvalidArg, "unsupported CGroup manager: %s - cannot validate cgroup parent", r.config.CgroupManager) } if pod.config.UsePodCgroup { @@ -146,7 +147,7 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) force = true } if !removeCtrs && numCtrs > 0 { - return errors.Wrapf(ErrCtrExists, "pod %s contains containers and cannot be removed", p.ID()) + return errors.Wrapf(define.ErrCtrExists, "pod %s contains containers and cannot be removed", p.ID()) } // Go through and lock all containers so we can operate on them all at @@ -290,7 +291,7 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) // keep going so we make sure to evict the pod before // ending up with an inconsistent state. if removalErr == nil { - removalErr = errors.Wrapf(ErrInternal, "unrecognized cgroup manager %s when removing pod %s cgroups", p.runtime.config.CgroupManager, p.ID()) + removalErr = errors.Wrapf(define.ErrInternal, "unrecognized cgroup manager %s when removing pod %s cgroups", p.runtime.config.CgroupManager, p.ID()) } else { logrus.Errorf("Unknown cgroups manager %s specified - cannot remove pod %s cgroup", p.runtime.config.CgroupManager, p.ID()) } |