summaryrefslogtreecommitdiff
path: root/libpod/boltdb_state.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-07-04 10:51:20 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-05 16:05:12 +0000
commitcc6f0e85f994cab66fb63c4dd8b77b4332151748 (patch)
tree6b54655b66a8571945ccda1601533717c8375906 /libpod/boltdb_state.go
parent33870ea2c3a3aa4e2bd3da3d84b21820c75eaf23 (diff)
downloadpodman-cc6f0e85f994cab66fb63c4dd8b77b4332151748.tar.gz
podman-cc6f0e85f994cab66fb63c4dd8b77b4332151748.tar.bz2
podman-cc6f0e85f994cab66fb63c4dd8b77b4332151748.zip
more changes to compile darwin
this should represent the last major changes to get darwin to **compile**. again, the purpose here is to get darwin to compile so that we can eventually implement a ci task that would protect against regressions for darwin compilation. i have left the manual darwin compilation largely static still and in fact now only interject (manually) two build tags to assist with the build. trevor king has great ideas on how to make this better and i will defer final implementation of those to him. Signed-off-by: baude <bbaude@redhat.com> Closes: #1047 Approved by: rhatdan
Diffstat (limited to 'libpod/boltdb_state.go')
-rw-r--r--libpod/boltdb_state.go33
1 files changed, 2 insertions, 31 deletions
diff --git a/libpod/boltdb_state.go b/libpod/boltdb_state.go
index d7c950fa0..45d09348e 100644
--- a/libpod/boltdb_state.go
+++ b/libpod/boltdb_state.go
@@ -7,7 +7,6 @@ import (
"github.com/boltdb/bolt"
"github.com/pkg/errors"
- "github.com/sirupsen/logrus"
)
// BoltState is a state implementation backed by a Bolt DB
@@ -443,32 +442,7 @@ func (s *BoltState) UpdateContainer(ctr *Container) error {
}
// Do we need to replace the container's netns?
- if netNSPath != "" {
- // Check if the container's old state has a good netns
- if ctr.state.NetNS != nil && netNSPath == ctr.state.NetNS.Path() {
- newState.NetNS = ctr.state.NetNS
- } else {
- // Tear down the existing namespace
- if err := s.runtime.teardownNetNS(ctr); err != nil {
- logrus.Warnf(err.Error())
- }
-
- // Open the new network namespace
- ns, err := joinNetNS(netNSPath)
- if err == nil {
- newState.NetNS = ns
- } else {
- logrus.Errorf("error joining network namespace for container %s", ctr.ID())
- ctr.valid = false
- }
- }
- } else {
- // The container no longer has a network namespace
- // Tear down the old one
- if err := s.runtime.teardownNetNS(ctr); err != nil {
- logrus.Warnf(err.Error())
- }
- }
+ ctr.setNamespace(netNSPath, newState)
// New state compiled successfully, swap it into the current state
ctr.state = newState
@@ -490,10 +464,7 @@ func (s *BoltState) SaveContainer(ctr *Container) error {
if err != nil {
return errors.Wrapf(err, "error marshalling container %s state to JSON", ctr.ID())
}
- netNSPath := ""
- if ctr.state.NetNS != nil {
- netNSPath = ctr.state.NetNS.Path()
- }
+ netNSPath := ctr.setNamespaceStatePath()
ctrID := []byte(ctr.ID())