containerd/cmd/ctr/delete.go
Michael Crosby 4f2b443a27 Rewrite imports for new github org
This rewrites the Go imports after switching to the new github org.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-04-03 14:05:44 -07:00

29 lines
606 B
Go

package main
import (
gocontext "context"
"errors"
"github.com/containerd/containerd/api/services/execution"
"github.com/urfave/cli"
)
var deleteCommand = cli.Command{
Name: "delete",
Usage: "delete an existing container",
ArgsUsage: "CONTAINER",
Action: func(context *cli.Context) error {
containers, err := getExecutionService(context)
if err != nil {
return err
}
id := context.Args().First()
if id == "" {
return errors.New(" id must be provided")
}
_, err = containers.Delete(gocontext.Background(), &execution.DeleteRequest{
ID: id,
})
return err
},
}