[sandbox] Cleanup interfaces

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2022-03-22 16:02:13 -07:00
parent de49745723
commit 85a49e4ee7
9 changed files with 57 additions and 1355 deletions

View File

@@ -47,12 +47,6 @@ type Sandbox interface {
Wait(ctx context.Context) (<-chan ExitStatus, error)
// Delete removes sandbox from the metadata store.
Delete(ctx context.Context) error
// Pause will freeze running sandbox instance
Pause(ctx context.Context) error
// Resume will unfreeze previously paused sandbox instance
Resume(ctx context.Context) error
// Ping will check whether existing sandbox instance alive
Ping(ctx context.Context) error
}
type sandboxClient struct {
@@ -127,18 +121,6 @@ func (s *sandboxClient) Delete(ctx context.Context) error {
return s.client.SandboxStore().Delete(ctx, s.ID())
}
func (s *sandboxClient) Pause(ctx context.Context) error {
return s.client.SandboxController().Pause(ctx, s.ID())
}
func (s *sandboxClient) Resume(ctx context.Context) error {
return s.client.SandboxController().Resume(ctx, s.ID())
}
func (s *sandboxClient) Ping(ctx context.Context) error {
return s.client.SandboxController().Ping(ctx, s.ID())
}
// NewSandbox creates new sandbox client
func (c *Client) NewSandbox(ctx context.Context, sandboxID string, opts ...NewSandboxOpts) (Sandbox, error) {
if sandboxID == "" {