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.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.go')
-rw-r--r-- | libpod/runtime_pod.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libpod/runtime_pod.go b/libpod/runtime_pod.go index b3dd7dabd..66f9b10c9 100644 --- a/libpod/runtime_pod.go +++ b/libpod/runtime_pod.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/util" "github.com/pkg/errors" ) @@ -30,7 +31,7 @@ func (r *Runtime) RemovePod(ctx context.Context, p *Pod, removeCtrs, force bool) defer r.lock.Unlock() if !r.valid { - return ErrRuntimeStopped + return define.ErrRuntimeStopped } if !p.valid { @@ -53,7 +54,7 @@ func (r *Runtime) GetPod(id string) (*Pod, error) { defer r.lock.RUnlock() if !r.valid { - return nil, ErrRuntimeStopped + return nil, define.ErrRuntimeStopped } return r.state.Pod(id) @@ -65,7 +66,7 @@ func (r *Runtime) HasPod(id string) (bool, error) { defer r.lock.RUnlock() if !r.valid { - return false, ErrRuntimeStopped + return false, define.ErrRuntimeStopped } return r.state.HasPod(id) @@ -78,7 +79,7 @@ func (r *Runtime) LookupPod(idOrName string) (*Pod, error) { defer r.lock.RUnlock() if !r.valid { - return nil, ErrRuntimeStopped + return nil, define.ErrRuntimeStopped } return r.state.LookupPod(idOrName) @@ -93,7 +94,7 @@ func (r *Runtime) Pods(filters ...PodFilter) ([]*Pod, error) { defer r.lock.RUnlock() if !r.valid { - return nil, ErrRuntimeStopped + return nil, define.ErrRuntimeStopped } pods, err := r.state.AllPods() @@ -122,7 +123,7 @@ func (r *Runtime) GetAllPods() ([]*Pod, error) { defer r.lock.RUnlock() if !r.valid { - return nil, ErrRuntimeStopped + return nil, define.ErrRuntimeStopped } return r.state.AllPods() @@ -137,7 +138,7 @@ func (r *Runtime) GetLatestPod() (*Pod, error) { return nil, errors.Wrapf(err, "unable to get all pods") } if len(pods) == 0 { - return nil, ErrNoSuchPod + return nil, define.ErrNoSuchPod } for podIndex, pod := range pods { createdTime := pod.config.CreatedTime @@ -159,7 +160,7 @@ func (r *Runtime) GetRunningPods() ([]*Pod, error) { defer r.lock.RUnlock() if !r.valid { - return nil, ErrRuntimeStopped + return nil, define.ErrRuntimeStopped } containers, err := r.GetRunningContainers() if err != nil { @@ -171,7 +172,7 @@ func (r *Runtime) GetRunningPods() ([]*Pod, error) { pods = append(pods, c.PodID()) pod, err := r.GetPod(c.PodID()) if err != nil { - if errors.Cause(err) == ErrPodRemoved || errors.Cause(err) == ErrNoSuchPod { + if errors.Cause(err) == define.ErrPodRemoved || errors.Cause(err) == define.ErrNoSuchPod { continue } return nil, err |