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 <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko committed 2026-11-02 09:45:08 -08:00
1 parent 1595317e06
commit 5aaba1c85d
1 file changed
+1 -1
+1 -1
View File
@@ -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
}