mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 05:17:02 +00:00
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:
1 file changed
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user