summaryrefslogtreecommitdiff
path: root/libpod/boltdb_state_internal.go
diff options
context:
space:
mode:
authorKunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>2018-12-12 11:26:32 +0900
committerKunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>2018-12-13 09:40:48 +0900
commit6b5666b659a590e8057a1272632f2f272f14c583 (patch)
treeee650b23b7bac1faf58eab633f5805e02f36b4b6 /libpod/boltdb_state_internal.go
parent8a3361f46c87933aff04c9acaaf48b7c130bc9d8 (diff)
downloadpodman-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.go4
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)