mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 23:38:24 +00:00
Add json tags and comments to exedriver types
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package lxc
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/dotcloud/docker/execdriver"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
@@ -14,15 +13,6 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
startPath = "lxc-start"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrNotRunning = errors.New("Process could not be started")
|
||||
ErrWaitTimeoutReached = errors.New("Wait timeout reached")
|
||||
)
|
||||
|
||||
type driver struct {
|
||||
root string // root path for the driver to use
|
||||
apparmor bool
|
||||
@@ -47,7 +37,7 @@ func (d *driver) Name() string {
|
||||
|
||||
func (d *driver) Run(c *execdriver.Process, startCallback execdriver.StartCallback) (int, error) {
|
||||
params := []string{
|
||||
startPath,
|
||||
"lxc-start",
|
||||
"-n", c.ID,
|
||||
"-f", c.ConfigPath,
|
||||
"--",
|
||||
@@ -155,7 +145,7 @@ func (d *driver) Wait(id string, duration time.Duration) error {
|
||||
return err
|
||||
case <-time.After(duration):
|
||||
killer = true
|
||||
return ErrWaitTimeoutReached
|
||||
return execdriver.ErrWaitTimeoutReached
|
||||
}
|
||||
} else {
|
||||
return <-done
|
||||
@@ -214,7 +204,7 @@ func (d *driver) waitForStart(c *execdriver.Process, waitLock chan struct{}) err
|
||||
}
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
}
|
||||
return ErrNotRunning
|
||||
return execdriver.ErrNotRunning
|
||||
}
|
||||
|
||||
func (d *driver) waitLxc(id string, kill *bool) <-chan error {
|
||||
|
||||
Reference in New Issue
Block a user