// NewAddonEnableCommand create addon enable command
NewAddonEnableCommand create addon enable command
// NewAddonEnableCommand create addon enable command
func NewAddonEnableCommand(ioStream cmdutil.IOStreams) *cobra.Command {
	return &cobra.Command{
		Use:     "enable",
		Short:   "enable an addon",
		Long:    "enable an addon in cluster",
		Example: "vela addon enable <addon-name>",
		RunE: func(cmd *cobra.Command, args []string) error {
			if len(args) < 1 {
				_, err := ioStream.Out.Write([]byte("Must specify addon name"))
				if err != nil {
					return err
				}
			}
			name := args[0]
			addonArgs, err := parseToMap(args[1:])
			if err != nil {
				return err
			}
			err = enableAddon(name, addonArgs)
			if err != nil {
				return err
			}
			return nil
		},
	}
}
func NewAddonEnableCommand ( ioStream cmdutil . IOStreams ) * cobra . Command { return & cobra . Command { Use : " " , Short : " " , Long : " " , Example : " " , RunE : func ( cmd * cobra . Command , args [ ] string ) error { if len ( args ) < 1 { _ , err := ioStream . Out . Write ( [ ] byte ( " " ) ) if err != nil { return err } } name := args [ 0 ] addonArgs , err := parseToMap ( args [ 1 : ] ) if err != nil { return err } err = enableAddon ( name , addonArgs ) if err != nil { return err } return nil } , } }
NewAddonEnableCommand create addon enable command
NewAddonEnableCommand create addon enable command