containerd/cmd/ctr/delete.go
Michael Crosby ab8586b7c5 Remove bundles from API
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-02-15 13:56:41 -08:00

29 lines
602 B
Go

package main
import (
gocontext "context"
"errors"
"github.com/docker/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
},
}