summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-12-13 06:51:26 -0800
committerGitHub <noreply@github.com>2018-12-13 06:51:26 -0800
commitd8d3950dd3c2ca15ae32bc94e1bedc088a66a1d8 (patch)
treea772cec1f54b7621aa3e7577d2247459681e272e /libpod
parentdb9fedde44f1607ca7acd5761c9c527604cd284c (diff)
parent6b5666b659a590e8057a1272632f2f272f14c583 (diff)
downloadpodman-d8d3950dd3c2ca15ae32bc94e1bedc088a66a1d8.tar.gz
podman-d8d3950dd3c2ca15ae32bc94e1bedc088a66a1d8.tar.bz2
podman-d8d3950dd3c2ca15ae32bc94e1bedc088a66a1d8.zip
Merge pull request #1990 from kunalkushwaha/bugfix-NamedVolumeCheck
condition fixed for adding volume to boltdb.
Diffstat (limited to 'libpod')
-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)