diff options
author | Lantao Liu <lantaol@google.com> | 2019-05-29 10:42:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-29 10:42:38 -0700 |
commit | c4b56cbf4332f985336950d9beae9352feb4aeab (patch) | |
tree | a92f66b518145bd9ae4958c6cea0183e5dadd700 /pkg/v1/shim/service.go | |
parent | 8a76657f6339f5d81a91712b55d3f36b5bbd5630 (diff) |
Create rootfs directory in shim. (#30)
Signed-off-by: Lantao Liu <lantaol@google.com>
Diffstat (limited to 'pkg/v1/shim/service.go')
-rw-r--r-- | pkg/v1/shim/service.go | 6 |
1 files changed, 5 insertions, 1 deletions
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 { |