From 42ecf4b6c8ea828d2c45fccf75f4950df6d9aea1 Mon Sep 17 00:00:00 2001 From: Zipofar Date: Mon, 18 Sep 2023 12:45:03 +0300 Subject: [PATCH] [324] Revert create cluster option name --- lib/uffizzi/cli/cluster.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/uffizzi/cli/cluster.rb b/lib/uffizzi/cli/cluster.rb index 8d859747..516afe1b 100644 --- a/lib/uffizzi/cli/cluster.rb +++ b/lib/uffizzi/cli/cluster.rb @@ -26,6 +26,7 @@ def list end desc 'create [NAME]', 'Create a cluster' + method_option :name, type: :string, required: false, aliases: '-n' method_option :kubeconfig, type: :string, required: false, aliases: '-k' method_option :manifest, type: :string, required: false, aliases: '-m' method_option :'update-current-context', type: :boolean, required: false, default: true @@ -103,9 +104,10 @@ def handle_list_command(project_slug) end end + # rubocop:disable Metrics/PerceivedComplexity def handle_create_command(project_slug, command_args) Uffizzi.ui.disable_stdout if Uffizzi.ui.output_format - cluster_name = command_args[:name] || ClusterService.generate_name + cluster_name = command_args[:name] || options[:name] || ClusterService.generate_name creation_source = options[:"creation-source"] || MANUAL unless ClusterService.valid_name?(cluster_name) @@ -132,6 +134,7 @@ def handle_create_command(project_slug, command_args) rescue SystemExit, Interrupt, SocketError handle_interrupt_creation(cluster_name, ConfigFile.read_option(:server), project_slug) end + # rubocop:enable Metrics/PerceivedComplexity def handle_describe_command(project_slug, command_args) cluster_data = fetch_cluster_data(project_slug, command_args[:cluster_name])