Module: Gitlab::Kubernetes::PodCmd

Defined in:
lib/gitlab/kubernetes/pod_cmd.rb

Overview

Miscellaneous commands that run in the helm-install-image pod, tuned to the idiosynchrasies of the default shell of helm-install-image

Class Method Summary collapse

Class Method Details

.retry_command(command, times: 3) ⇒ Object



9
10
11
# File 'lib/gitlab/kubernetes/pod_cmd.rb', line 9

def retry_command(command, times: 3)
  "for i in $(seq 1 #{times.to_i}); do #{command} && s=0 && break || s=$?; sleep 1s; echo \"Retrying ($i)...\"; done; (exit $s)"
end