mirror of https://github.com/containers/podman.git
				
				
				
			condition fixed for adding volume to boltdb.
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
This commit is contained in:
		
							parent
							
								
									8a3361f46c
								
							
						
					
					
						commit
						6b5666b659
					
				|  | @ -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