INNER CODE UNIT · Go

newCreateCmd

rabbitmq/cluster-operator · kubectl-rabbitmq/commands.go:44

func newCreateCmd(getExecutor func() *kubectlExecutor) *cobra.Command {
	var opts clusterOptions

	cmd := &cobra.Command{
		Use:   "create INSTANCE",
		Short: "Create a RabbitMQ cluster",
		Args:  cobra.ExactArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			executor := getExecutor()
			instanceName := args[0]

			cluster, err := buildRabbitmqCluster(instanceName, opts)
			if err != nil {
				return fmt.Errorf("failed to build cluster: %w", err)
			}

			return applyCluster(executor, cluster)
		},

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…