From 782a98709b300f20b1a18394d7913f91e5b2ef39 Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Fri, 29 Mar 2024 16:33:09 +0530 Subject: [PATCH 1/4] grammar and typo on address --- lib/uffizzi/cli/install.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uffizzi/cli/install.rb b/lib/uffizzi/cli/install.rb index a2f0f4e7..40106366 100644 --- a/lib/uffizzi/cli/install.rb +++ b/lib/uffizzi/cli/install.rb @@ -72,7 +72,7 @@ def build_installation_options(uri) end def wait_ip - spinner = TTY::Spinner.new('[:spinner] Waiting IP addess...', format: :dots) + spinner = TTY::Spinner.new('[:spinner] Waiting on IP address...', format: :dots) spinner.auto_spin ip = nil From 28795bac98e527ddb4c9bb788071fa20f1787cfe Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Fri, 29 Mar 2024 16:38:07 +0530 Subject: [PATCH 2/4] remove waiting for the certificate --- lib/uffizzi/cli/install.rb | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/lib/uffizzi/cli/install.rb b/lib/uffizzi/cli/install.rb index 40106366..60d0db41 100644 --- a/lib/uffizzi/cli/install.rb +++ b/lib/uffizzi/cli/install.rb @@ -97,29 +97,6 @@ def wait_ip ip end - def wait_certificate_request_ready(uri) - spinner = TTY::Spinner.new('[:spinner] Waiting create certificate for controller host...', format: :dots) - spinner.auto_spin - - try = 0 - - loop do - requests = InstallService.get_certificate_request(namespace, uri) - break if requests.all? { |r| r['status'].downcase == 'true' } - - if try == 60 - spinner.error - - return Uffizzi.ui.say('Stop waiting creation certificate') - end - - try += 1 - sleep(2) - end - - spinner.success - end - def build_helm_values(params) { global: { @@ -220,7 +197,6 @@ def build_controller_setting_params(uri, installation_options) def say_success(uri) ip_address = wait_ip - wait_certificate_request_ready(uri) msg = 'Your Uffizzi controller is ready. To configure DNS,'\ " create a record for the hostname '*.#{uri.host}' pointing to '#{ip_address}'" From 91c720ceb21018f35ca7a4513bab0fee65cd1e8a Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Fri, 29 Mar 2024 16:42:31 +0530 Subject: [PATCH 3/4] remove unused get certificate request func --- lib/uffizzi/services/install_service.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/uffizzi/services/install_service.rb b/lib/uffizzi/services/install_service.rb index 032bf613..f443b04e 100644 --- a/lib/uffizzi/services/install_service.rb +++ b/lib/uffizzi/services/install_service.rb @@ -98,17 +98,6 @@ def get_controller_ip(namespace) load_balancers.map { |i| i['ip'] }[0] end - def get_certificate_request(namespace, uri) - cmd = "kubectl get certificaterequests -n #{namespace} -o json" - res = execute_command(cmd, say: false) - certificate_request = JSON.parse(res)['items'].detect { |i| i['metadata']['name'].include?(uri.host) } - - return [] if certificate_request.nil? - - conditions = certificate_request.dig('status', 'conditions') || [] - conditions.map { |c| c.slice('type', 'status') } - end - def build_controller_host(host) [DEFAULT_CONTROLLER_DOMAIN_PREFIX, host].join('.') end From 2e0d09aad8cf21d123f3d69b980400a1d8fd97eb Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Fri, 29 Mar 2024 16:51:30 +0530 Subject: [PATCH 4/4] add shorthand alias for the --namespace flag --- lib/uffizzi/cli/uninstall.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uffizzi/cli/uninstall.rb b/lib/uffizzi/cli/uninstall.rb index 95961528..6711f112 100644 --- a/lib/uffizzi/cli/uninstall.rb +++ b/lib/uffizzi/cli/uninstall.rb @@ -12,7 +12,7 @@ class Cli::Uninstall < Thor default_task :controller desc 'controller [HOSTNAME]', 'Install uffizzi controller to cluster' - method_option :namespace, type: :string + method_option :namespace, type: :string, aliases: '-n' method_option :context, type: :string def controller Uffizzi::AuthHelper.check_login