mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-03 05:21:30 +02:00
Introduce service accounts and bootstrap tokens (#22)
This commit is contained in:
@@ -7,10 +7,10 @@ import (
|
||||
func NewCommand() *cobra.Command {
|
||||
command := &cobra.Command{
|
||||
Use: "delete",
|
||||
Short: "Delete resources from the controller (VMs)",
|
||||
Short: "Delete resources from the controller",
|
||||
}
|
||||
|
||||
command.AddCommand(newDeleteVMCommand())
|
||||
command.AddCommand(newDeleteVMCommand(), newDeleteServiceComandCommand())
|
||||
|
||||
return command
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package deletecmd
|
||||
|
||||
import (
|
||||
"github.com/cirruslabs/orchard/pkg/client"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func newDeleteServiceComandCommand() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "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)
|
||||
}
|
||||
Reference in New Issue
Block a user