From 8d7872499e70f5cea06aa7a4f160e6a39d8b9da8 Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Mon, 24 Jun 2024 17:16:47 +0200 Subject: [PATCH 1/2] [#417] fix error when installation returns a hostname instead of an ip address --- lib/uffizzi/cli/install.rb | 14 +++++++------- lib/uffizzi/services/install_service.rb | 7 +++++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/uffizzi/cli/install.rb b/lib/uffizzi/cli/install.rb index 2024a5d0..011adfb6 100644 --- a/lib/uffizzi/cli/install.rb +++ b/lib/uffizzi/cli/install.rb @@ -71,16 +71,16 @@ def build_installation_options(uri) } end - def wait_ip + def wait_endpoint spinner = TTY::Spinner.new('[:spinner] Waiting on IP address...', format: :dots) spinner.auto_spin - ip = nil + endpoint = nil try = 0 loop do - ip = InstallService.get_controller_ip(namespace) - break if ip.present? + endpoint = InstallService.get_controller_endpoint(namespace) + break if endpoint.present? if try == 90 spinner.error @@ -94,7 +94,7 @@ def wait_ip spinner.success - ip + endpoint end def build_helm_values(params) @@ -196,10 +196,10 @@ def build_controller_setting_params(uri, installation_options) end def say_success(uri) - ip_address = wait_ip + endpoint = wait_endpoint msg = 'Your Uffizzi controller is ready. To configure DNS,'\ - " create a record for the hostname '*.#{uri.host}' pointing to '#{ip_address}'" + " create a record for the hostname '*.#{uri.host}' pointing to '#{endpoint}'" Uffizzi.ui.say(msg) end diff --git a/lib/uffizzi/services/install_service.rb b/lib/uffizzi/services/install_service.rb index eac73be7..9874afd9 100644 --- a/lib/uffizzi/services/install_service.rb +++ b/lib/uffizzi/services/install_service.rb @@ -85,7 +85,7 @@ def kubeconfig_current_context execute_command(cmd, say: false) { |stdout| stdout.present? && stdout.chop } end - def get_controller_ip(namespace) + def get_controller_endpoint(namespace) cmd = "kubectl get ingress -n #{namespace} -o json" res = execute_command(cmd, say: false) ingress = JSON.parse(res)['items'].detect { |i| i['metadata']['name'] = INGRESS_NAME } @@ -95,7 +95,10 @@ def get_controller_ip(namespace) load_balancers = ingress.dig('status', 'loadBalancer', 'ingress') return if load_balancers.blank? - load_balancers.map { |i| i['ip'] }[0] + ip = load_balancers.map { |i| i['ip'] }[0] + return ip if ip.present? + + load_balancers.map { |i| i['hostname'] }[0] end def build_controller_host(host) From fe5aae374891f468bd7e9489f1d2143fe8df46ee Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Wed, 26 Jun 2024 11:13:25 +0200 Subject: [PATCH 2/2] Change version to 2.4.10 --- Gemfile.lock | 14 +++++++++----- lib/uffizzi/version.rb | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8ae90e47..2ed5d41d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - uffizzi-cli (2.4.9) + uffizzi-cli (2.4.10) activesupport awesome_print faker @@ -26,8 +26,10 @@ GEM public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) awesome_print (1.9.2) + bigdecimal (3.1.8) bump (0.10.0) byebug (11.1.3) + childprocess (5.0.0) coderay (1.1.3) concurrent-ruby (1.1.9) crack (0.4.5) @@ -36,15 +38,16 @@ GEM factory_bot (6.2.0) activesupport (>= 5.0.0) fakefs (1.8.0) - faker (3.2.2) + faker (3.4.1) i18n (>= 1.8.11, < 2) hashdiff (1.0.1) i18n (1.8.11) concurrent-ruby (~> 1.0) kramdown (2.3.1) rexml - launchy (2.5.2) + launchy (3.0.1) addressable (~> 2.8) + childprocess (~> 5.0) method_source (1.0.0) minitar (0.9) minitest (5.14.4) @@ -100,9 +103,10 @@ GEM rubocop (~> 1.0) ruby-progressbar (1.11.0) securerandom (0.3.1) - sentry-ruby (5.15.2) + sentry-ruby (5.18.0) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) - thor (1.3.0) + thor (1.3.1) tty-color (0.6.0) tty-cursor (0.7.1) tty-prompt (0.23.1) diff --git a/lib/uffizzi/version.rb b/lib/uffizzi/version.rb index 3502e98b..bc37e322 100644 --- a/lib/uffizzi/version.rb +++ b/lib/uffizzi/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Uffizzi - VERSION = '2.4.9' + VERSION = '2.4.10' end