Skip to content

Commit 48b81e8

Browse files
committed
Do not return error when rootfs already exists.
Signed-off-by: Lantao Liu <[email protected]>
1 parent 25daa73 commit 48b81e8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

runtime/v1/shim/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (_ *
127127
rootfs := ""
128128
if len(mounts) > 0 {
129129
rootfs = filepath.Join(r.Bundle, "rootfs")
130-
if err := os.Mkdir(rootfs, 0711); err != nil {
130+
if err := os.Mkdir(rootfs, 0711); err != nil && !os.IsExist(err) {
131131
return nil, err
132132
}
133133
}

runtime/v2/runc/container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func NewContainer(ctx context.Context, platform rproc.Platform, r *task.CreateTa
6868
rootfs := ""
6969
if len(mounts) > 0 {
7070
rootfs = filepath.Join(r.Bundle, "rootfs")
71-
if err := os.Mkdir(rootfs, 0711); err != nil {
71+
if err := os.Mkdir(rootfs, 0711); err != nil && !os.IsExist(err) {
7272
return nil, err
7373
}
7474
}

0 commit comments

Comments
 (0)