From 633133a21881eb14996fc34a3ccf19526e83dd1b Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Mon, 9 Oct 2023 18:10:03 +0200 Subject: [PATCH] [339] fix handling of missing current cluster config --- lib/uffizzi/cli/cluster.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/uffizzi/cli/cluster.rb b/lib/uffizzi/cli/cluster.rb index fd87e874..bd27424b 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).fetch(:name) + cluster_name = command_args[:cluster_name] || ConfigFile.read_option(:current_cluster)&.fetch(:name) return handle_missing_cluster_name_error if cluster_name.nil? response = scale_down_cluster(ConfigFile.read_option(:server), project_slug, cluster_name) @@ -256,7 +256,7 @@ def handle_sleep_command(project_slug, command_args) end def handle_wake_command(project_slug, command_args) - cluster_name = command_args[:cluster_name] || ConfigFile.read_option(:current_cluster).fetch(:name) + cluster_name = command_args[:cluster_name] || ConfigFile.read_option(:current_cluster)&.fetch(:name) return handle_missing_cluster_name_error if cluster_name.nil? response = scale_up_cluster(ConfigFile.read_option(:server), project_slug, cluster_name)