mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-21 10:45:25 +02:00
Use golangci-lint (#15)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package deletecmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func NewCommand() *cobra.Command {
|
||||
command := &cobra.Command{
|
||||
Use: "delete",
|
||||
Short: "Delete resources from the controller (VMs)",
|
||||
}
|
||||
|
||||
command.AddCommand(newDeleteVMCommand())
|
||||
|
||||
return command
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package deletecmd
|
||||
|
||||
import (
|
||||
"github.com/cirruslabs/orchard/pkg/client"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func newDeleteVMCommand() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "vm",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: runDeleteVM,
|
||||
}
|
||||
}
|
||||
|
||||
func runDeleteVM(cmd *cobra.Command, args []string) error {
|
||||
name := args[0]
|
||||
|
||||
client, err := client.New()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return client.VMs().Delete(cmd.Context(), name, false)
|
||||
}
|
||||
Reference in New Issue
Block a user