diff --git a/libcontainerd/client_unix.go b/libcontainerd/client_unix.go index 456e21fceb..6dbf3af06e 100644 --- a/libcontainerd/client_unix.go +++ b/libcontainerd/client_unix.go @@ -83,8 +83,7 @@ func (clnt *client) Create(containerID string, checkpoint string, checkpointDir if err := json.NewEncoder(f).Encode(spec); err != nil { return err } - - return container.start(checkpoint, checkpointDir, attachStdio) + return container.start(&spec, checkpoint, checkpointDir, attachStdio) } func (clnt *client) Signal(containerID string, sig int) error { diff --git a/libcontainerd/container_unix.go b/libcontainerd/container_unix.go index f2413b2e3f..be1699943e 100644 --- a/libcontainerd/container_unix.go +++ b/libcontainerd/container_unix.go @@ -90,12 +90,7 @@ func (ctr *container) spec() (*specs.Spec, error) { return &spec, nil } -func (ctr *container) start(checkpoint string, checkpointDir string, attachStdio StdioCallback) (err error) { - spec, err := ctr.spec() - if err != nil { - return nil - } - +func (ctr *container) start(spec *specs.Spec, checkpoint, checkpointDir string, attachStdio StdioCallback) (err error) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() ready := make(chan struct{}) @@ -172,6 +167,7 @@ func (ctr *container) start(checkpoint string, checkpointDir string, attachStdio State: StateStart, Pid: ctr.systemPid, }}) + } func (ctr *container) newProcess(friendlyName string) *process {