Skip to content

Commit 42ecf4b

Browse files
committed
[324] Revert create cluster option name
1 parent d64e62b commit 42ecf4b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/uffizzi/cli/cluster.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def list
2626
end
2727

2828
desc 'create [NAME]', 'Create a cluster'
29+
method_option :name, type: :string, required: false, aliases: '-n'
2930
method_option :kubeconfig, type: :string, required: false, aliases: '-k'
3031
method_option :manifest, type: :string, required: false, aliases: '-m'
3132
method_option :'update-current-context', type: :boolean, required: false, default: true
@@ -103,9 +104,10 @@ def handle_list_command(project_slug)
103104
end
104105
end
105106

107+
# rubocop:disable Metrics/PerceivedComplexity
106108
def handle_create_command(project_slug, command_args)
107109
Uffizzi.ui.disable_stdout if Uffizzi.ui.output_format
108-
cluster_name = command_args[:name] || ClusterService.generate_name
110+
cluster_name = command_args[:name] || options[:name] || ClusterService.generate_name
109111
creation_source = options[:"creation-source"] || MANUAL
110112

111113
unless ClusterService.valid_name?(cluster_name)
@@ -132,6 +134,7 @@ def handle_create_command(project_slug, command_args)
132134
rescue SystemExit, Interrupt, SocketError
133135
handle_interrupt_creation(cluster_name, ConfigFile.read_option(:server), project_slug)
134136
end
137+
# rubocop:enable Metrics/PerceivedComplexity
135138

136139
def handle_describe_command(project_slug, command_args)
137140
cluster_data = fetch_cluster_data(project_slug, command_args[:cluster_name])

0 commit comments

Comments
 (0)