diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-11-26 16:54:44 +0300 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-11-27 14:54:32 +0300 |
commit | 6a66e4a1f116ff98d8f9b8dffa3beed62d74e0b3 (patch) | |
tree | 8482cbcee599f0c63172d2559eea37a44335d8fc /lib/gitlab/kubernetes | |
parent | 242baf1287302bded45164558986150ac8d9881f (diff) |
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.
Diffstat (limited to 'lib/gitlab/kubernetes')
-rw-r--r-- | lib/gitlab/kubernetes/helm/api.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/kubernetes/helm/api.rb b/lib/gitlab/kubernetes/helm/api.rb index fd3d187cbc3..b9903e37f40 100644 --- a/lib/gitlab/kubernetes/helm/api.rb +++ b/lib/gitlab/kubernetes/helm/api.rb @@ -16,12 +16,16 @@ module Gitlab create_cluster_role_binding(command) create_config_map(command) + delete_pod!(command.pod_name) kubeclient.create_pod(command.pod_resource) end def update(command) namespace.ensure_exists! + update_config_map(command) + + delete_pod!(command.pod_name) kubeclient.create_pod(command.pod_resource) end @@ -42,6 +46,8 @@ module Gitlab def delete_pod!(pod_name) kubeclient.delete_pod(pod_name, namespace.name) + rescue ::Kubeclient::ResourceNotFoundError + # no-op end def get_config_map(config_map_name) |