Update sandbox API to return target platform

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2023-01-08 14:22:19 -08:00
parent dd22a3a806
commit f318e5630b
12 changed files with 1026 additions and 557 deletions

View File

@@ -135,6 +135,22 @@ func (c *controllerLocal) Start(ctx context.Context, in *api.ControllerStartRequ
}, nil
}
func (c *controllerLocal) Platform(ctx context.Context, in *api.ControllerPlatformRequest, opts ...grpc.CallOption) (*api.ControllerPlatformResponse, error) {
svc, err := c.getSandbox(ctx, in.SandboxID)
if err != nil {
return nil, err
}
response, err := svc.Platform(ctx, &runtimeAPI.PlatformRequest{SandboxID: in.GetSandboxID()})
if err != nil {
return nil, fmt.Errorf("failed to get sandbox platform: %w", err)
}
return &api.ControllerPlatformResponse{
Platform: response.GetPlatform(),
}, nil
}
func (c *controllerLocal) Stop(ctx context.Context, in *api.ControllerStopRequest, opts ...grpc.CallOption) (*api.ControllerStopResponse, error) {
svc, err := c.getSandbox(ctx, in.SandboxID)
if err != nil {