Merge pull request #798 from sak0/dev
ctr exec: container id must be provided
This commit is contained in:
commit
c3efbc37bc
@ -19,7 +19,7 @@ var deleteCommand = cli.Command{
|
|||||||
}
|
}
|
||||||
id := context.Args().First()
|
id := context.Args().First()
|
||||||
if id == "" {
|
if id == "" {
|
||||||
return errors.New(" id must be provided")
|
return errors.New("container id must be provided")
|
||||||
}
|
}
|
||||||
_, err = containers.Delete(gocontext.Background(), &execution.DeleteRequest{
|
_, err = containers.Delete(gocontext.Background(), &execution.DeleteRequest{
|
||||||
ID: id,
|
ID: id,
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/containerd/containerd/api/services/execution"
|
"github.com/containerd/containerd/api/services/execution"
|
||||||
"github.com/crosbymichael/console"
|
"github.com/crosbymichael/console"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -32,6 +33,9 @@ var execCommand = cli.Command{
|
|||||||
id = context.String("id")
|
id = context.String("id")
|
||||||
ctx = gocontext.Background()
|
ctx = gocontext.Background()
|
||||||
)
|
)
|
||||||
|
if id == "" {
|
||||||
|
return errors.New("container id must be provided")
|
||||||
|
}
|
||||||
|
|
||||||
containers, err := getExecutionService(context)
|
containers, err := getExecutionService(context)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
var killCommand = cli.Command{
|
var killCommand = cli.Command{
|
||||||
Name: "kill",
|
Name: "kill",
|
||||||
Usage: "signal a container",
|
Usage: "signal a container (default: SIGTERM)",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "id",
|
Name: "id",
|
||||||
|
Loading…
Reference in New Issue
Block a user