Merge pull request #3299 from Random-Liu/use-mkdirall
Not return error when rootfs already exists
This commit is contained in:
commit
01191a21b0
@ -127,7 +127,7 @@ func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (_ *
|
||||
rootfs := ""
|
||||
if len(mounts) > 0 {
|
||||
rootfs = filepath.Join(r.Bundle, "rootfs")
|
||||
if err := os.Mkdir(rootfs, 0711); err != nil {
|
||||
if err := os.Mkdir(rootfs, 0711); err != nil && !os.IsExist(err) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ func NewContainer(ctx context.Context, platform rproc.Platform, r *task.CreateTa
|
||||
rootfs := ""
|
||||
if len(mounts) > 0 {
|
||||
rootfs = filepath.Join(r.Bundle, "rootfs")
|
||||
if err := os.Mkdir(rootfs, 0711); err != nil {
|
||||
if err := os.Mkdir(rootfs, 0711); err != nil && !os.IsExist(err) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user