Remove bundles from API
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
1dc5d652ac
commit
ab8586b7c5
48 changed files with 3287 additions and 5946 deletions
|
@ -10,43 +10,20 @@ import (
|
|||
|
||||
var deleteCommand = cli.Command{
|
||||
Name: "delete",
|
||||
Usage: "delete a process from containerd store",
|
||||
Usage: "delete an existing container",
|
||||
ArgsUsage: "CONTAINER",
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "pid, p",
|
||||
Usage: "process id to be deleted",
|
||||
},
|
||||
},
|
||||
Action: func(context *cli.Context) error {
|
||||
executionService, err := getExecutionService(context)
|
||||
containers, err := getExecutionService(context)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
id := context.Args().First()
|
||||
if id == "" {
|
||||
return errors.New("container id must be provided")
|
||||
return errors.New(" id must be provided")
|
||||
}
|
||||
|
||||
pid := uint32(context.Int64("pid"))
|
||||
if pid != 0 {
|
||||
_, err = executionService.DeleteProcess(gocontext.Background(), &execution.DeleteProcessRequest{
|
||||
ContainerID: id,
|
||||
Pid: pid,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if _, err := executionService.DeleteContainer(gocontext.Background(), &execution.DeleteContainerRequest{
|
||||
_, err = containers.Delete(gocontext.Background(), &execution.DeleteRequest{
|
||||
ID: id,
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
return err
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue