Merge pull request #853 from AkihiroSuda/check-rootfs

linux: error out if no rootfs specified
This commit is contained in:
Derek McGowan
2017-05-16 10:38:25 -07:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -117,6 +117,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