[sandbox] Implement sandbox controller
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
@@ -324,7 +324,8 @@ func (m *ShimManager) Get(ctx context.Context, id string) (ShimProcess, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return proc, nil
|
||||
shimTask := proc.(*shimTask)
|
||||
return shimTask, nil
|
||||
}
|
||||
|
||||
// Delete a runtime task
|
||||
|
||||
@@ -194,6 +194,8 @@ type ShimProcess interface {
|
||||
ID() string
|
||||
// Namespace of this shim.
|
||||
Namespace() string
|
||||
// Client returns the underlying TTRPC client for this shim.
|
||||
Client() *ttrpc.Client
|
||||
}
|
||||
|
||||
type shim struct {
|
||||
@@ -243,6 +245,10 @@ type shimTask struct {
|
||||
task task.TaskService
|
||||
}
|
||||
|
||||
func (s *shimTask) Client() *ttrpc.Client {
|
||||
return s.client
|
||||
}
|
||||
|
||||
func (s *shimTask) Shutdown(ctx context.Context) error {
|
||||
_, err := s.task.Shutdown(ctx, &task.ShutdownRequest{
|
||||
ID: s.ID(),
|
||||
|
||||
Reference in New Issue
Block a user