mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-31 16:36:38 +00:00
Merge pull request #394 from liubin/393/handle-rpc-call-not-implemented
runtime: handle unimplemented RPC call by NotFound status code
This commit is contained in:
@@ -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")))
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user