Create/delete containerd containerd
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
@@ -19,6 +19,7 @@ package server
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/containerd/containerd/api/services/containers"
|
||||
"github.com/containerd/containerd/snapshot"
|
||||
"github.com/golang/glog"
|
||||
"golang.org/x/net/context"
|
||||
@@ -84,6 +85,14 @@ func (c *criContainerdService) RemoveContainer(ctx context.Context, r *runtime.R
|
||||
containerRootDir, err)
|
||||
}
|
||||
|
||||
// Delete containerd container.
|
||||
if _, err := c.containerService.Delete(ctx, &containers.DeleteContainerRequest{ID: id}); err != nil {
|
||||
if !isContainerdGRPCNotFoundError(err) {
|
||||
return nil, fmt.Errorf("failed to delete containerd container %q: %v", id, err)
|
||||
}
|
||||
glog.V(5).Infof("Remove called for containerd container %q that does not exist", id, err)
|
||||
}
|
||||
|
||||
// Delete container metadata.
|
||||
if err := c.containerStore.Delete(id); err != nil {
|
||||
return nil, fmt.Errorf("failed to delete container metadata for %q: %v", id, err)
|
||||
|
||||
Reference in New Issue
Block a user