Create/remove sandbox container.
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/api/services/execution"
|
||||
"github.com/containerd/containerd/snapshot"
|
||||
"github.com/golang/glog"
|
||||
@@ -82,6 +83,14 @@ func (c *criContainerdService) RemovePodSandbox(ctx context.Context, r *runtime.
|
||||
sandboxRootDir, err)
|
||||
}
|
||||
|
||||
// Delete sandbox container.
|
||||
if _, err := c.containerService.Delete(ctx, &containers.DeleteContainerRequest{ID: id}); err != nil {
|
||||
if !isContainerdGRPCNotFoundError(err) {
|
||||
return nil, fmt.Errorf("failed to delete sandbox container %q: %v", id, err)
|
||||
}
|
||||
glog.V(5).Infof("Remove called for sandbox container %q that does not exist", id, err)
|
||||
}
|
||||
|
||||
// Remove sandbox metadata from metadata store. Note that once the sandbox
|
||||
// metadata is successfully deleted:
|
||||
// 1) ListPodSandbox will not include this sandbox.
|
||||
|
||||
Reference in New Issue
Block a user