diff options
author | baude <bbaude@redhat.com> | 2018-07-04 10:51:20 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-07-05 16:05:12 +0000 |
commit | cc6f0e85f994cab66fb63c4dd8b77b4332151748 (patch) | |
tree | 6b54655b66a8571945ccda1601533717c8375906 /libpod/boltdb_state_internal.go | |
parent | 33870ea2c3a3aa4e2bd3da3d84b21820c75eaf23 (diff) | |
download | podman-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_internal.go')
-rw-r--r-- | libpod/boltdb_state_internal.go | 60 |
1 files changed, 1 insertions, 59 deletions
diff --git a/libpod/boltdb_state_internal.go b/libpod/boltdb_state_internal.go index e8aa6860b..69e7bee21 100644 --- a/libpod/boltdb_state_internal.go +++ b/libpod/boltdb_state_internal.go @@ -205,60 +205,6 @@ func getRuntimeConfigBucket(tx *bolt.Tx) (*bolt.Bucket, error) { return bkt, nil } -func (s *BoltState) getContainerFromDB(id []byte, ctr *Container, ctrsBkt *bolt.Bucket) error { - valid := true - ctrBkt := ctrsBkt.Bucket(id) - if ctrBkt == nil { - return errors.Wrapf(ErrNoSuchCtr, "container %s not found in DB", string(id)) - } - - configBytes := ctrBkt.Get(configKey) - if configBytes == nil { - return errors.Wrapf(ErrInternal, "container %s missing config key in DB", string(id)) - } - - stateBytes := ctrBkt.Get(stateKey) - if stateBytes == nil { - return errors.Wrapf(ErrInternal, "container %s missing state key in DB", string(id)) - } - - netNSBytes := ctrBkt.Get(netNSKey) - - if err := json.Unmarshal(configBytes, ctr.config); err != nil { - return errors.Wrapf(err, "error unmarshalling container %s config", string(id)) - } - - if err := json.Unmarshal(stateBytes, ctr.state); err != nil { - return errors.Wrapf(err, "error unmarshalling container %s state", string(id)) - } - - // The container may not have a network namespace, so it's OK if this is - // nil - if netNSBytes != nil { - nsPath := string(netNSBytes) - netNS, err := joinNetNS(nsPath) - if err == nil { - ctr.state.NetNS = netNS - } else { - logrus.Errorf("error joining network namespace for container %s", ctr.ID()) - valid = false - } - } - - // Get the lock - lockPath := filepath.Join(s.lockDir, string(id)) - lock, err := storage.GetLockfile(lockPath) - if err != nil { - return errors.Wrapf(err, "error retrieving lockfile for container %s", string(id)) - } - ctr.lock = lock - - ctr.runtime = s.runtime - ctr.valid = valid - - return nil -} - func (s *BoltState) getPodFromDB(id []byte, pod *Pod, podBkt *bolt.Bucket) error { podDB := podBkt.Bucket(id) if podDB == nil { @@ -310,11 +256,7 @@ func (s *BoltState) addContainer(ctr *Container, pod *Pod) 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() dependsCtrs := ctr.Dependencies() ctrID := []byte(ctr.ID()) |