Sandbox: Add Metrics rpc for controller
As a follow up change to adding a SandboxMetrics rpc to the core sandbox service, the controller needed a corresponding rpc for CRI and others to eventually implement. This leaves the CRI (non-shim mode) controller unimplemented just to have a change with the API addition to start. Signed-off-by: Danny Canter <danny@dcantah.dev>
This commit is contained in:
@@ -162,3 +162,15 @@ func (s *controllerService) Shutdown(ctx context.Context, req *api.ControllerShu
|
||||
log.G(ctx).WithField("req", req).Debug("shutdown sandbox")
|
||||
return &api.ControllerShutdownResponse{}, errdefs.ToGRPC(s.local.Shutdown(ctx, req.GetSandboxID()))
|
||||
}
|
||||
|
||||
func (s *controllerService) Metrics(ctx context.Context, req *api.ControllerMetricsRequest) (*api.ControllerMetricsResponse, error) {
|
||||
log.G(ctx).WithField("req", req).Debug("sandbox metrics")
|
||||
|
||||
metrics, err := s.local.Metrics(ctx, req.GetSandboxID())
|
||||
if err != nil {
|
||||
return &api.ControllerMetricsResponse{}, errdefs.ToGRPC(err)
|
||||
}
|
||||
return &api.ControllerMetricsResponse{
|
||||
Metrics: metrics,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user