Added some ctl boilerplate

This commit is contained in:
2026-03-27 18:34:53 +08:00
parent bf85462e34
commit 87aa1d4b0b
30 changed files with 1813 additions and 19 deletions

View 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
}