create src dir for bind mounts
match docker behavior for bind mounts Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
a28ed75e12
commit
f3650533f0
1 changed files with 4 additions and 0 deletions
|
@ -47,6 +47,10 @@ func addOciBindMounts(sb *sandbox, containerConfig *pb.ContainerConfig, specgen
|
||||||
return fmt.Errorf("Mount.HostPath is empty")
|
return fmt.Errorf("Mount.HostPath is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, err := os.Stat(src); err != nil && os.IsNotExist(err) {
|
||||||
|
os.MkdirAll(src, 0644)
|
||||||
|
}
|
||||||
|
|
||||||
options := []string{"rw"}
|
options := []string{"rw"}
|
||||||
if mount.Readonly {
|
if mount.Readonly {
|
||||||
options = []string{"ro"}
|
options = []string{"ro"}
|
||||||
|
|
Loading…
Reference in a new issue