Added some ctl boilerplate
This commit is contained in:
31
clitools/pkg/cmd/create/create.go
Normal file
31
clitools/pkg/cmd/create/create.go
Normal file
@@ -0,0 +1,31 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user