diff --git a/container_linux_test.go b/container_linux_test.go index 43c1d6904..55b275385 100644 --- a/container_linux_test.go +++ b/container_linux_test.go @@ -1178,6 +1178,10 @@ func TestContainerLoadUnexistingProcess(t *testing.T) { t.Fatal("an error should have occurred when loading a process that does not exist") } + if !errdefs.IsNotFound(err) { + t.Fatalf("an error of type NotFound should have been returned when loading a process that does not exist, got %#v instead ", err) + } + if err := task.Kill(ctx, syscall.SIGKILL); err != nil { t.Error(err) } diff --git a/runtime/v2/runc/v2/service.go b/runtime/v2/runc/v2/service.go index 7f15ee89b..cf478ca5e 100644 --- a/runtime/v2/runc/v2/service.go +++ b/runtime/v2/runc/v2/service.go @@ -483,7 +483,7 @@ func (s *service) State(ctx context.Context, r *taskAPI.StateRequest) (*taskAPI. } p, err := container.Process(r.ExecID) if err != nil { - return nil, err + return nil, errdefs.ToGRPC(err) } st, err := p.Status(ctx) if err != nil {