mirror of
https://github.com/holos-run/holos.git
synced 2026-03-19 16:54:58 +00:00
This patch adds a holos create secret command that behaves like kubectl create secret, but for the specific use case of provisioning holos clusters. ``` ❯ holos create secret k2-talos --cluster-name=k2 --from-file=secrets.yaml 4:48PM INF secret.go:104 created: k2-talos-49546d9fd7 version=0.45.0 secret=k2-talos-49546d9fd7 name=k2-talos namespace=secrets ``` Once the corresponding `holos get secret` subcommands are implemented the kv subcommand may be removed.
24 lines
567 B
Go
24 lines
567 B
Go
package create
|
|
|
|
import (
|
|
"github.com/holos-run/holos/pkg/cli/command"
|
|
"github.com/holos-run/holos/pkg/cli/secret"
|
|
"github.com/holos-run/holos/pkg/holos"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// New returns the create command for the cli
|
|
func New(hc *holos.Config) *cobra.Command {
|
|
cmd := command.New("create")
|
|
cmd.Short = "create resources"
|
|
cmd.Flags().SortFlags = false
|
|
cmd.RunE = func(c *cobra.Command, args []string) error {
|
|
return c.Usage()
|
|
}
|
|
// flags
|
|
cmd.PersistentFlags().SortFlags = false
|
|
// commands
|
|
cmd.AddCommand(secret.NewCreateCmd(hc))
|
|
return cmd
|
|
}
|