cmd/deploycontroller.go
func DeployControllerCmd() *cobra.Command {
	var dco = &cli.DeployControllerOptions{}
	var deployControllerCmd = &cobra.Command{
		Use:   "deploycontroller <NAME>",
		Short: "Deploy a controller for a given cluster",
		Long: `Use this command to deploy a controller for a given cluster.

As long as a controller is defined, this will create the deployment and the namespace.`,
		Run: func(cmd *cobra.Command, args []string) {
			switch len(args) {
			case 0:
				dco.Name = viper.GetString(keyKubicornName)
			case 1:
				dco.Name = args[0]
			default:
				logger.Critical("Too many arguments.")
				os.Exit(1)
			}

			if err := runDeployController(dco); err != nil {
				logger.Critical(err.Error())
				os.Exit(1)
			}

		},
	}

	fs := deployControllerCmd.Flags()

	bindCommonStateStoreFlags(&dco.StateStoreOptions, fs)
	bindCommonAwsFlags(&dco.AwsOptions, fs)

	fs.StringVar(&dco.GitRemote, keyGitConfig, viper.GetString(keyGitConfig), descGitConfig)

	return deployControllerCmd
}
func DeployControllerCmd() *cobra.Command {
	var dco = &cli.DeployControllerOptions{}
	var deployControllerCmd = &cobra.Command{
		Use:   "deploycontroller <NAME>",
		Short: "Deploy a controller for a given cluster",
		Long: `Use this command to deploy a controller for a given cluster.

As long as a controller is defined, this will create the deployment and the namespace.`,
		Run: func(cmd *cobra.Command, args []string) {
			switch len(args) {
			case 0:
				dco.Name = viper.GetString(keyKubicornName)
			case 1:
				dco.Name = args[0]
			default:
				logger.Critical("Too many arguments.")
				os.Exit(1)
			}

			if err := runDeployController(dco); err != nil {
				logger.Critical(err.Error())
				os.Exit(1)
			}

		},
	}

	fs := deployControllerCmd.Flags()

	bindCommonStateStoreFlags(&dco.StateStoreOptions, fs)
	bindCommonAwsFlags(&dco.AwsOptions, fs)

	fs.StringVar(&dco.GitRemote, keyGitConfig, viper.GetString(keyGitConfig), descGitConfig)

	return deployControllerCmd
}
// DeployControllerCmd represents the apply command