let user to specify the shim name or path

Signed-off-by: mYmNeo <thomassong@tencent.com>
This commit is contained in:
mYmNeo 2016-04-06 14:42:47 +08:00
parent 5e5daf2b33
commit 4eb27a5926
6 changed files with 21 additions and 9 deletions

View file

@ -27,6 +27,7 @@ func (s *Supervisor) start(t *StartTask) error {
Bundle: t.BundlePath,
Runtime: s.runtime,
RuntimeArgs: s.runtimeArgs,
Shim: s.shim,
Labels: t.Labels,
NoPivotRoot: t.NoPivotRoot,
Timeout: s.timeout,

View file

@ -18,7 +18,7 @@ const (
)
// New returns an initialized Process supervisor.
func New(stateDir string, runtimeName string, runtimeArgs []string, timeout time.Duration) (*Supervisor, error) {
func New(stateDir string, runtimeName, shimName string, runtimeArgs []string, timeout time.Duration) (*Supervisor, error) {
startTasks := make(chan *startTask, 10)
if err := os.MkdirAll(stateDir, 0755); err != nil {
return nil, err
@ -41,6 +41,7 @@ func New(stateDir string, runtimeName string, runtimeArgs []string, timeout time
monitor: monitor,
runtime: runtimeName,
runtimeArgs: runtimeArgs,
shim: shimName,
timeout: timeout,
}
if err := setupEventLog(s); err != nil {
@ -109,6 +110,7 @@ type Supervisor struct {
// name of the OCI compatible runtime used to execute containers
runtime string
runtimeArgs []string
shim string
containers map[string]*containerInfo
startTasks chan *startTask
// we need a lock around the subscribers map only because additions and deletions from