diff --git a/src/runtime/containerd-shim-v2/errors_test.go b/src/runtime/containerd-shim-v2/errors_test.go index e1e90a3e9e..3657ffbec5 100644 --- a/src/runtime/containerd-shim-v2/errors_test.go +++ b/src/runtime/containerd-shim-v2/errors_test.go @@ -35,5 +35,6 @@ func TestIsGRPCErrorCode(t *testing.T) { assert := assert.New(t) assert.True(isGRPCErrorCode(codes.Unimplemented, status.New(codes.Unimplemented, "foobar").Err())) + assert.True(isGRPCErrorCode(codes.NotFound, status.New(codes.NotFound, "foobar").Err())) assert.False(isGRPCErrorCode(codes.Unimplemented, errors.New("foobar"))) } diff --git a/src/runtime/containerd-shim-v2/wait.go b/src/runtime/containerd-shim-v2/wait.go index 815178bade..3db0e7f9ac 100644 --- a/src/runtime/containerd-shim-v2/wait.go +++ b/src/runtime/containerd-shim-v2/wait.go @@ -145,7 +145,8 @@ func watchOOMEvents(ctx context.Context, s *service) { logrus.WithField("sandbox", s.sandbox.ID()).WithError(err).Warn("failed to get OOM event from sandbox") // If the GetOOMEvent call is not implemented, then the agent is most likely an older version, // stop attempting to get OOM events. - if isGRPCErrorCode(codes.Unimplemented, err) { + // for rust agent, the response code is not found + if isGRPCErrorCode(codes.NotFound, err) { return } continue