1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00
Files
incus/cmd/incus-benchmark/main_delete.go
Stéphane Graber 8b1312b205 incus-benchmark: Move to cmd/incus-benchmark
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-08-04 15:29:12 -04:00

37 lines
615 B
Go

package main
import (
"github.com/spf13/cobra"
)
type cmdDelete struct {
global *cmdGlobal
}
func (c *cmdDelete) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Use = "delete"
cmd.Short = "Delete containers"
cmd.RunE = c.Run
return cmd
}
func (c *cmdDelete) Run(cmd *cobra.Command, args []string) error {
// Get the containers
containers, err := GetContainers(c.global.srv)
if err != nil {
return err
}
// Run the test
duration, err := DeleteContainers(c.global.srv, containers, c.global.flagParallel)
if err != nil {
return err
}
c.global.reportDuration = duration
return nil
}