|
| 1 | +package main |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + |
| 6 | + "github.com/sirupsen/logrus" |
| 7 | + "github.com/spf13/cobra" |
| 8 | +) |
| 9 | + |
| 10 | +func newImageBasedCmd(ctx context.Context) *cobra.Command { |
| 11 | + imagebasedCmd := &cobra.Command{ |
| 12 | + Use: "image-based", |
| 13 | + Short: "Commands for supporting cluster installation using the Image-based installer", |
| 14 | + RunE: func(cmd *cobra.Command, args []string) error { |
| 15 | + return cmd.Help() |
| 16 | + }, |
| 17 | + } |
| 18 | + |
| 19 | + imagebasedCmd.AddCommand(newImageBasedCreateCmd(ctx)) |
| 20 | + return imagebasedCmd |
| 21 | +} |
| 22 | + |
| 23 | +func newImageBasedCreateCmd(ctx context.Context) *cobra.Command { |
| 24 | + cmd := &cobra.Command{ |
| 25 | + Use: "create", |
| 26 | + Short: "Commands for generating image-based installer artifacts", |
| 27 | + RunE: func(cmd *cobra.Command, args []string) error { |
| 28 | + return cmd.Help() |
| 29 | + }, |
| 30 | + } |
| 31 | + |
| 32 | + cmd.AddCommand(createImageConfigTemplateCmd()) |
| 33 | + cmd.AddCommand(createImageCmd()) |
| 34 | + cmd.AddCommand(createConfigTemplateCmd()) |
| 35 | + cmd.AddCommand(createConfigImageCmd()) |
| 36 | + |
| 37 | + return cmd |
| 38 | +} |
| 39 | + |
| 40 | +func createImageConfigTemplateCmd() *cobra.Command { |
| 41 | + return &cobra.Command{ |
| 42 | + Use: "image-config-template", |
| 43 | + Short: "Generates a template of the Image-based Installation ISO config manifest used by the Image-based installer", |
| 44 | + Args: cobra.ExactArgs(0), |
| 45 | + Run: func(_ *cobra.Command, _ []string) { |
| 46 | + logrus.Info("Create image config template command") |
| 47 | + }, |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +func createImageCmd() *cobra.Command { |
| 52 | + return &cobra.Command{ |
| 53 | + Use: "image", |
| 54 | + Short: "Generates a bootable ISO image containing all the information needed to deploy a cluster", |
| 55 | + Args: cobra.ExactArgs(0), |
| 56 | + Run: func(_ *cobra.Command, _ []string) { |
| 57 | + logrus.Info("Create image command") |
| 58 | + }, |
| 59 | + } |
| 60 | +} |
| 61 | + |
| 62 | +func createConfigTemplateCmd() *cobra.Command { |
| 63 | + return &cobra.Command{ |
| 64 | + Use: "config-template", |
| 65 | + Short: "Generates a template of the Image-based Config ISO config manifest used by the Image-based installer", |
| 66 | + Args: cobra.ExactArgs(0), |
| 67 | + Run: func(_ *cobra.Command, _ []string) { |
| 68 | + logrus.Info("Create config template command") |
| 69 | + }, |
| 70 | + } |
| 71 | +} |
| 72 | + |
| 73 | +func createConfigImageCmd() *cobra.Command { |
| 74 | + return &cobra.Command{ |
| 75 | + Use: "config-image", |
| 76 | + Short: "Generates an ISO containing configuration files only", |
| 77 | + Args: cobra.ExactArgs(0), |
| 78 | + Run: func(_ *cobra.Command, _ []string) { |
| 79 | + logrus.Info("Create config image command") |
| 80 | + }, |
| 81 | + } |
| 82 | +} |
0 commit comments