🏗️ move make sub-cmd to sub-dir
This commit is contained in:
26
internal/cmd/makecmd/flannel.go
Normal file
26
internal/cmd/makecmd/flannel.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package makecmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"yizhisec.com/hsv2/forge/internal/controller/maker"
|
||||
)
|
||||
|
||||
func Flannel() *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
|
||||
}
|
||||
Reference in New Issue
Block a user