penguin/monok8s

k8s image for Mono Gateway Dev Kit

clitools/pkg/cmd/create/create.go

raw ยท 713 bytes

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
}