[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

@@ -38,7 +38,6 @@ var Command = cli.Command{
runCommand,
listCommand,
removeCommand,
pingCommand,
},
}
@@ -177,30 +176,3 @@ var removeCommand = cli.Command{
return nil
},
}
var pingCommand = cli.Command{
Name: "ping",
ArgsUsage: "<id> [<id>, ...]",
Usage: "ping sandbox",
Action: func(context *cli.Context) error {
client, ctx, cancel, err := commands.NewClient(context)
if err != nil {
return err
}
defer cancel()
for _, id := range context.Args() {
sandbox, err := client.LoadSandbox(ctx, id)
if err != nil {
return fmt.Errorf("failed to load sandbox %s: %w", id, err)
}
err = sandbox.Ping(ctx)
if err != nil {
return fmt.Errorf("failed to ping %s: %w", id, err)
}
}
return nil
},
}