package cmd

import (
	"github.com/spf13/cobra"
	"yizhisec.com/hsv2/forge/internal/controller/maker"
)

func makeFlannel() *cobra.Command {
	var (
		_mode string
	)

	cmd := &cobra.Command{
		Use:   "flannel",
		Short: "Build Flannel resources",
		Long:  `Build and prepare Flannel network resources.`,
		RunE: func(cmd *cobra.Command, args []string) error {
			mk := maker.NewMaker()
			return mk.Flannel(cmd.Context(), _mode)
		},
	}

	cmd.Flags().StringVar(&_mode, "mode", "host-gw", "Flannel backend mode (vxlan or host-gw)")

	return cmd
}
