From c4b56cbf4332f985336950d9beae9352feb4aeab Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Wed, 29 May 2019 10:42:38 -0700 Subject: Create rootfs directory in shim. (#30) Signed-off-by: Lantao Liu --- pkg/v1/shim/service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/v1/shim/service.go') diff --git a/pkg/v1/shim/service.go b/pkg/v1/shim/service.go index 083dfa534..b9e1c0ced 100644 --- a/pkg/v1/shim/service.go +++ b/pkg/v1/shim/service.go @@ -125,6 +125,11 @@ func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (_ * }) } + rootfs := filepath.Join(r.Bundle, "rootfs") + if err := os.Mkdir(rootfs, 0711); err != nil && !os.IsExist(err) { + return nil, err + } + config := &proc.CreateConfig{ ID: r.ID, Bundle: r.Bundle, @@ -136,7 +141,6 @@ func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (_ * Stderr: r.Stderr, Options: r.Options, } - rootfs := filepath.Join(r.Bundle, "rootfs") defer func() { if err != nil { if err2 := mount.UnmountAll(rootfs, 0); err2 != nil { -- cgit v1.2.3