Files
orchard/internal/command/deletecmd/service_account.go
T
Nikolay Edigaryev 5c3b47a247 --help fixes and new "orchard logs vm" command (#41)
* Make sure we list names/VM names as required argument in the --help

* Introduce "orchard logs vm" command

* Make sure each command has a Short field

* Future-proof port-forward, ssh and vnc commands

To support not only the VM resource.
2023-03-23 15:59:57 +04:00

27 lines
555 B
Go

package deletecmd
import (
"github.com/cirruslabs/orchard/pkg/client"
"github.com/spf13/cobra"
)
func newDeleteServiceComandCommand() *cobra.Command {
return &cobra.Command{
Use: "service-account NAME",
Short: "Delete a service account",
Args: cobra.ExactArgs(1),
RunE: runDeleteServiceAccountCommand,
}
}
func runDeleteServiceAccountCommand(cmd *cobra.Command, args []string) error {
name := args[0]
client, err := client.New()
if err != nil {
return err
}
return client.ServiceAccounts().Delete(cmd.Context(), name, false)
}