Fix runtime root with no-shim

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2017-11-07 12:12:53 -05:00
parent fc08f019f3
commit d01fb047f4

View File

@ -98,12 +98,16 @@ func (s *Service) newInitProcess(context context.Context, r *shimapi.CreateTaskR
return nil, errors.Wrapf(err, "failed to mount rootfs component %v", m) return nil, errors.Wrapf(err, "failed to mount rootfs component %v", m)
} }
} }
root := s.config.RuntimeRoot
if root == "" {
root = RuncRoot
}
runtime := &runc.Runc{ runtime := &runc.Runc{
Command: r.Runtime, Command: r.Runtime,
Log: filepath.Join(s.config.Path, "log.json"), Log: filepath.Join(s.config.Path, "log.json"),
LogFormat: runc.JSON, LogFormat: runc.JSON,
PdeathSignal: syscall.SIGKILL, PdeathSignal: syscall.SIGKILL,
Root: filepath.Join(s.config.RuntimeRoot, s.config.Namespace), Root: filepath.Join(root, s.config.Namespace),
Criu: s.config.Criu, Criu: s.config.Criu,
SystemdCgroup: s.config.SystemdCgroup, SystemdCgroup: s.config.SystemdCgroup,
} }