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

@@ -11,6 +11,7 @@ import (
"syscall"
"time"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
"github.com/containerd/console"
@@ -36,6 +37,9 @@ type initProcess struct {
}
func newInitProcess(context context.Context, path string, r *shimapi.CreateRequest) (*initProcess, error) {
if len(r.Rootfs) == 0 {
return nil, errors.New("no rootfs was specified")
}
for _, rm := range r.Rootfs {
m := &containerd.Mount{
Type: rm.Type,