diff options
Diffstat (limited to 'lib/gitlab/kubernetes/helm')
-rw-r--r-- | lib/gitlab/kubernetes/helm/client_command.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/kubernetes/helm/reset_command.rb | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/kubernetes/helm/client_command.rb b/lib/gitlab/kubernetes/helm/client_command.rb index 6ae68306a9b..a3f732e1283 100644 --- a/lib/gitlab/kubernetes/helm/client_command.rb +++ b/lib/gitlab/kubernetes/helm/client_command.rb @@ -17,7 +17,8 @@ module Gitlab # This is necessary to give Tiller time to restart after upgrade. # Ideally we'd be able to use --wait but cannot because of # https://github.com/helm/helm/issues/4855 - "for i in $(seq 1 30); do #{helm_check} && break; sleep 1s; echo \"Retrying ($i)...\"; done" + + "for i in $(seq 1 30); do #{helm_check} && s=0 && break || s=$?; sleep 1s; echo \"Retrying ($i)...\"; done; (exit $s)" end def repository_command diff --git a/lib/gitlab/kubernetes/helm/reset_command.rb b/lib/gitlab/kubernetes/helm/reset_command.rb index c8349639ec3..13176360227 100644 --- a/lib/gitlab/kubernetes/helm/reset_command.rb +++ b/lib/gitlab/kubernetes/helm/reset_command.rb @@ -18,7 +18,8 @@ module Gitlab def generate_script super + [ reset_helm_command, - delete_tiller_replicaset + delete_tiller_replicaset, + delete_tiller_clusterrolebinding ].join("\n") end @@ -43,6 +44,12 @@ module Gitlab Gitlab::Kubernetes::KubectlCmd.delete(*delete_args) end + def delete_tiller_clusterrolebinding + delete_args = %w[clusterrolebinding tiller-admin] + + Gitlab::Kubernetes::KubectlCmd.delete(*delete_args) + end + def reset_helm_command command = %w[helm reset] + optional_tls_flags |