diff options
author | Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp> | 2018-12-12 11:26:32 +0900 |
---|---|---|
committer | Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp> | 2018-12-13 09:40:48 +0900 |
commit | 6b5666b659a590e8057a1272632f2f272f14c583 (patch) | |
tree | ee650b23b7bac1faf58eab633f5805e02f36b4b6 /libpod/boltdb_state_internal.go | |
parent | 8a3361f46c87933aff04c9acaaf48b7c130bc9d8 (diff) | |
download | podman-6b5666b659a590e8057a1272632f2f272f14c583.tar.gz podman-6b5666b659a590e8057a1272632f2f272f14c583.tar.bz2 podman-6b5666b659a590e8057a1272632f2f272f14c583.zip |
condition fixed for adding volume to boltdb.
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
Diffstat (limited to 'libpod/boltdb_state_internal.go')
-rw-r--r-- | libpod/boltdb_state_internal.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/boltdb_state_internal.go b/libpod/boltdb_state_internal.go index 0970f4d41..06f8dcb24 100644 --- a/libpod/boltdb_state_internal.go +++ b/libpod/boltdb_state_internal.go @@ -565,10 +565,12 @@ func (s *BoltState) addContainer(ctr *Container, pod *Pod) error { } // Add container to volume dependencies bucket if container is using a named volume + if ctr.runtime.config.VolumePath == "" { + return nil + } for _, vol := range ctr.config.Spec.Mounts { if strings.Contains(vol.Source, ctr.runtime.config.VolumePath) { volName := strings.Split(vol.Source[len(ctr.runtime.config.VolumePath)+1:], "/")[0] - volDB := volBkt.Bucket([]byte(volName)) if volDB == nil { return errors.Wrapf(ErrNoSuchVolume, "no volume with name %s found in database", volName) |