Add exec id check on client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
96b041e1f9
commit
cd4e8ba448
@ -23,6 +23,7 @@ var (
|
|||||||
ErrNoRunningTask = errors.New("no running task")
|
ErrNoRunningTask = errors.New("no running task")
|
||||||
ErrDeleteRunningTask = errors.New("cannot delete container with running task")
|
ErrDeleteRunningTask = errors.New("cannot delete container with running task")
|
||||||
ErrProcessExited = errors.New("process already exited")
|
ErrProcessExited = errors.New("process already exited")
|
||||||
|
ErrNoExecID = errors.New("exec id must be provided")
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeleteOpts func(context.Context, *Client, containers.Container) error
|
type DeleteOpts func(context.Context, *Client, containers.Container) error
|
||||||
|
3
task.go
3
task.go
@ -191,6 +191,9 @@ func (t *task) Delete(ctx context.Context) (uint32, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreate IOCreation) (Process, error) {
|
func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreate IOCreation) (Process, error) {
|
||||||
|
if id == "" {
|
||||||
|
return nil, ErrNoExecID
|
||||||
|
}
|
||||||
i, err := ioCreate()
|
i, err := ioCreate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user