From 5aaba1c85df532b51ae852b2cb2bd0e1815fa62b Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Tue, 8 Sep 2026 19:32:32 -0700 Subject: [PATCH] sandbox: convert shim metrics errors to native errors controllerLocal.Metrics returned the shim's gRPC status error as is, unlike every other method of the controller. CRI's pod stats listing tolerates NotFound and Unavailable from a controller but never matched a status error, so one sandbox whose shim could not report metrics failed ListPodSandboxStats for every pod on the node. Signed-off-by: Maksym Pavlenko --- plugins/sandbox/controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sandbox/controller.go b/plugins/sandbox/controller.go index 823af3ec9b..52fa8caf54 100644 --- a/plugins/sandbox/controller.go +++ b/plugins/sandbox/controller.go @@ -339,7 +339,7 @@ func (c *controllerLocal) Metrics(ctx context.Context, sandboxID string) (*types req := &runtimeAPI.SandboxMetricsRequest{SandboxID: sandboxID} resp, err := sb.SandboxMetrics(ctx, req) if err != nil { - return nil, err + return nil, errgrpc.ToNative(err) } return resp.Metrics, nil }