Files
monok8s/clitools/pkg/cmd/create/create.go

32 lines
713 B
Go

package create
import (
"fmt"
"undecided.project/monok8s/pkg/templates"
"github.com/spf13/cobra"
)
func NewCmdCreate() *cobra.Command {
cmd := &cobra.Command{Use: "create", Short: "Create starter resources"}
cmd.AddCommand(
&cobra.Command{
Use: "config",
Short: "Print a MonoKSConfig template",
RunE: func(cmd *cobra.Command, _ []string) error {
_, err := fmt.Fprint(cmd.OutOrStdout(), templates.MonoKSConfigYAML)
return err
},
},
&cobra.Command{
Use: "osupgrade",
Short: "Print an OSUpgrade template",
RunE: func(cmd *cobra.Command, _ []string) error {
_, err := fmt.Fprint(cmd.OutOrStdout(), templates.OSUpgradeYAML)
return err
},
},
)
return cmd
}