diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-12-02 16:31:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-02 16:31:11 +0100 |
commit | e4275b3453598c3cdcf1ee00ff73c55780aef444 (patch) | |
tree | 15915f36125dfd9db9d56440f2a89f0610aa52fc /libpod/boltdb_state_linux.go | |
parent | 39c705e9405faa4d02b71165d05eec1e7bb44d93 (diff) | |
parent | 6c405b5fbcc83ba49c187087eb4e1ccc1a7ff147 (diff) | |
download | podman-e4275b3453598c3cdcf1ee00ff73c55780aef444.tar.gz podman-e4275b3453598c3cdcf1ee00ff73c55780aef444.tar.bz2 podman-e4275b3453598c3cdcf1ee00ff73c55780aef444.zip |
Merge pull request #4493 from mheon/add_removing_state
Add ContainerStateRemoving
Diffstat (limited to 'libpod/boltdb_state_linux.go')
-rw-r--r-- | libpod/boltdb_state_linux.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libpod/boltdb_state_linux.go b/libpod/boltdb_state_linux.go index 09a9be606..6ccda71bd 100644 --- a/libpod/boltdb_state_linux.go +++ b/libpod/boltdb_state_linux.go @@ -3,6 +3,8 @@ package libpod import ( + "github.com/containers/libpod/libpod/define" + "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -25,8 +27,12 @@ func replaceNetNS(netNSPath string, ctr *Container, newState *ContainerState) er if err == nil { newState.NetNS = ns } else { + if ctr.ensureState(define.ContainerStateRunning, define.ContainerStatePaused) { + return errors.Wrapf(err, "error joning network namespace of container %s", ctr.ID()) + } + logrus.Errorf("error joining network namespace for container %s: %v", ctr.ID(), err) - ctr.valid = false + ctr.state.NetNS = nil } } } else { |