From c6437ca43a44edfc9cd28e1eb5a0e72aec1d7aeb Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Mon, 9 Oct 2023 17:37:10 +0200 Subject: [PATCH] [339] fix handling of missing current cluster config --- lib/uffizzi/cli/cluster.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uffizzi/cli/cluster.rb b/lib/uffizzi/cli/cluster.rb index 1c8d9fe2..74bab423 100644 --- a/lib/uffizzi/cli/cluster.rb +++ b/lib/uffizzi/cli/cluster.rb @@ -241,7 +241,7 @@ def handle_update_kubeconfig_command(project_slug, command_args) end def handle_sleep_command(project_slug, command_args) - cluster_name = command_args[:cluster_name] || ConfigFile.read_option(:current_cluster)[:name] + cluster_name = command_args[:cluster_name] || ConfigFile.read_option(:current_cluster).try(:name) return handle_missing_cluster_name_error if cluster_name.nil? response = scale_down_cluster(ConfigFile.read_option(:server), project_slug, cluster_name)