Merge pull request #1651 from lifupan/fix_rootfs

shimv2: create the rootfs dir if it doesn't exist
This commit is contained in:
Hui Zhu 2019-05-10 09:45:52 +08:00 committed by GitHub
commit 9ab09f9c2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,