mirror of https://github.com/containers/podman.git
Merge pull request #1990 from kunalkushwaha/bugfix-NamedVolumeCheck
condition fixed for adding volume to boltdb.
This commit is contained in:
commit
d8d3950dd3
|
@ -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
|
// 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 {
|
for _, vol := range ctr.config.Spec.Mounts {
|
||||||
if strings.Contains(vol.Source, ctr.runtime.config.VolumePath) {
|
if strings.Contains(vol.Source, ctr.runtime.config.VolumePath) {
|
||||||
volName := strings.Split(vol.Source[len(ctr.runtime.config.VolumePath)+1:], "/")[0]
|
volName := strings.Split(vol.Source[len(ctr.runtime.config.VolumePath)+1:], "/")[0]
|
||||||
|
|
||||||
volDB := volBkt.Bucket([]byte(volName))
|
volDB := volBkt.Bucket([]byte(volName))
|
||||||
if volDB == nil {
|
if volDB == nil {
|
||||||
return errors.Wrapf(ErrNoSuchVolume, "no volume with name %s found in database", volName)
|
return errors.Wrapf(ErrNoSuchVolume, "no volume with name %s found in database", volName)
|
||||||
|
|
Loading…
Reference in New Issue