linux: error out if no rootfs specified

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2017-05-14 13:55:58 +00:00
parent 7b2bf52f62
commit 7a62734d82
2 changed files with 7 additions and 0 deletions

View File

@@ -111,6 +111,9 @@ func (r *Runtime) Create(ctx context.Context, id string, opts plugin.CreateOpts)
Options: m.Options,
})
}
if len(sopts.Rootfs) == 0 {
return nil, fmt.Errorf("no rootfs was specified for id %s", id)
}
if _, err := s.Create(ctx, sopts); err != nil {
os.RemoveAll(path)
return nil, err