Return NotFound error for kill and delete in deleted state.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-04-26 14:36:40 -07:00
parent 3a3f0aac88
commit dff7456804
3 changed files with 5 additions and 4 deletions

View File

@@ -22,6 +22,7 @@ import (
"context"
"github.com/containerd/console"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/runtime/proc"
google_protobuf "github.com/gogo/protobuf/types"
"github.com/pkg/errors"
@@ -55,11 +56,11 @@ func (s *deletedState) Start(ctx context.Context) error {
}
func (s *deletedState) Delete(ctx context.Context) error {
return errors.Errorf("cannot delete a deleted process")
return errors.Wrap(errdefs.ErrNotFound, "cannot delete a deleted process")
}
func (s *deletedState) Kill(ctx context.Context, sig uint32, all bool) error {
return errors.Errorf("cannot kill a deleted process")
return errors.Wrap(errdefs.ErrNotFound, "cannot kill a deleted process")
}
func (s *deletedState) SetExited(status int) {