Add json storage for container storage

This is just a temporary storage solution to get
containers running on the new code.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2017-05-23 13:00:30 -07:00
parent 539742881d
commit e1ed4a2ea4
6 changed files with 118 additions and 11 deletions

View File

@@ -3,6 +3,9 @@ package main
import (
gocontext "context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
containersapi "github.com/containerd/containerd/api/services/containers"
"github.com/containerd/containerd/api/services/execution"
"github.com/pkg/errors"
@@ -43,7 +46,11 @@ var deleteCommand = cli.Command{
ContainerID: id,
})
if err != nil {
return errors.Wrap(err, "failed to delete container")
// Ignore error if task has already been removed, task is
// removed by default after run
if grpc.Code(errors.Cause(err)) != codes.NotFound {
return errors.Wrap(err, "failed to task container")
}
}
if err := snapshotter.Remove(ctx, id); err != nil {