Skip to content

Commit

Permalink
[324] Revert create cluster option name
Browse files Browse the repository at this point in the history
  • Loading branch information
zipofar committed Sep 18, 2023
1 parent d64e62b commit 42ecf4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/uffizzi/cli/cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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])
Expand Down

0 comments on commit 42ecf4b

Please sign in to comment.