mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-31 07:19:06 +00:00
Merge pull request #1651 from lifupan/fix_rootfs
shimv2: create the rootfs dir if it doesn't exist
This commit is contained in:
commit
9ab09f9c2d
@ -210,6 +210,16 @@ func checkAndMount(s *service, r *taskAPI.CreateTaskRequest) error {
|
||||
}
|
||||
|
||||
func doMount(mounts []*containerd_types.Mount, rootfs string) error {
|
||||
if len(mounts) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
if _, err := os.Stat(rootfs); os.IsNotExist(err) {
|
||||
if err := os.Mkdir(rootfs, 0711); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
for _, rm := range mounts {
|
||||
m := &mount.Mount{
|
||||
Type: rm.Type,
|
||||
|
Loading…
Reference in New Issue
Block a user