diff options
author | haircommander <pehunt@redhat.com> | 2018-08-20 17:56:35 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-08-23 18:16:28 +0000 |
commit | 0e6266858a913ac36de0726ede10d5d03af533e3 (patch) | |
tree | 152c7b8b029d5eb80c6caf466c9d0ab1b0ef3913 /libpod/runtime_pod_linux.go | |
parent | 2a7449362f2884d9ae6a783c0ce38979d882e2cf (diff) | |
download | podman-0e6266858a913ac36de0726ede10d5d03af533e3.tar.gz podman-0e6266858a913ac36de0726ede10d5d03af533e3.tar.bz2 podman-0e6266858a913ac36de0726ede10d5d03af533e3.zip |
Fixing network ns segfault
As well as small style corrections, update pod_top_test to use CreatePod, and move handling of adding a container to the pod's namespace from container_internal_linux to libpod/option.
Signed-off-by: haircommander <pehunt@redhat.com>
Closes: #1187
Approved by: mheon
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r-- | libpod/runtime_pod_linux.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index b4530081c..17629defe 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -115,12 +115,8 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (*Pod, } func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) error { - if !p.valid { - if ok, _ := r.state.HasPod(p.ID()); !ok { - // Pod probably already removed - // Or was never in the runtime to begin with - return nil - } + if err := p.updatePod(); err != nil { + return err } ctrs, err := r.state.PodContainers(p) @@ -131,9 +127,6 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) numCtrs := len(ctrs) // If the only container in the pod is the pause container, remove the pod and container unconditionally. - if err := p.updatePod(); err != nil { - return err - } pauseCtrID := p.state.InfraContainerID if numCtrs == 1 && ctrs[0].ID() == pauseCtrID { removeCtrs = true |