mirror of
https://github.com/containers/podman.git
synced 2025-10-20 04:34:01 +08:00
condition fixed for adding volume to boltdb.
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
This commit is contained in:
@ -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)
|
||||||
|
Reference in New Issue
Block a user