From 6a66e4a1f116ff98d8f9b8dffa3beed62d74e0b3 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Mon, 26 Nov 2018 14:54:44 +0100 Subject: Don't remove failed install pods We want to keep failed install pods around so that it is easier to debug why a failure occured. With this change we also need to ensure that we remove a previous pod with the same name before installing so that re-install does not fail. Another change here is that we no longer need to catch errors from delete_pod! in CheckInstallationProgressService as we now catch the ResourceNotFoundError in Helm::Api. The catch statement in CheckInstallationProgressService was also probably too broad before and should have been narrowed down simply to ResourceNotFoundError. --- .../applications/check_installation_progress_service.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'app/services/clusters') diff --git a/app/services/clusters/applications/check_installation_progress_service.rb b/app/services/clusters/applications/check_installation_progress_service.rb index ca0f7b30053..6794580e1e8 100644 --- a/app/services/clusters/applications/check_installation_progress_service.rb +++ b/app/services/clusters/applications/check_installation_progress_service.rb @@ -29,17 +29,13 @@ module Clusters end def on_failed - app.make_errored!('Installation failed') - ensure - remove_installation_pod + app.make_errored!("Installation failed. Check pod logs for #{install_command.pod_name} for more details.") end def check_timeout if timeouted? begin - app.make_errored!('Installation timed out') - ensure - remove_installation_pod + app.make_errored!("Installation timed out. Check pod logs for #{install_command.pod_name} for more details.") end else ClusterWaitForAppInstallationWorker.perform_in( @@ -53,9 +49,6 @@ module Clusters def remove_installation_pod helm_api.delete_pod!(install_command.pod_name) - rescue => e - Rails.logger.error("Kubernetes error: #{e.class.name} #{e.message}") - # no-op end def installation_phase -- cgit v1.2.3