| 104 | } |
| 105 | |
| 106 | func (s *remoteSandboxController) Stop(ctx context.Context, sandboxID string, opts ...sandbox.StopOpt) error { |
| 107 | var soptions sandbox.StopOptions |
| 108 | for _, opt := range opts { |
| 109 | opt(&soptions) |
| 110 | } |
| 111 | req := &api.ControllerStopRequest{ |
| 112 | SandboxID: sandboxID, |
| 113 | Sandboxer: s.sandboxerName, |
| 114 | } |
| 115 | if soptions.Timeout != nil { |
| 116 | req.TimeoutSecs = uint32(soptions.Timeout.Seconds()) |
| 117 | } |
| 118 | _, err := s.client.Stop(ctx, req) |
| 119 | if err != nil { |
| 120 | return errgrpc.ToNative(err) |
| 121 | } |
| 122 | |
| 123 | return nil |
| 124 | } |
| 125 | |
| 126 | func (s *remoteSandboxController) Shutdown(ctx context.Context, sandboxID string) error { |
| 127 | _, err := s.client.Shutdown(ctx, &api.ControllerShutdownRequest{ |