File tree Expand file tree Collapse file tree 15 files changed +70
-15
lines changed Expand file tree Collapse file tree 15 files changed +70
-15
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ aemm_helm_args=(
57
57
aemm_helm_args+=(" ${common_helm_args[@]} " )
58
58
59
59
set -x
60
- helm " ${aemm_helm_args[@]} "
60
+ retry 5 helm " ${aemm_helm_args[@]} "
61
61
set +x
62
62
63
63
emtp_helm_args=(
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ aemm_helm_args=(
80
80
aemm_helm_args+=(" ${common_helm_args[@]} " )
81
81
82
82
set -x
83
- helm " ${aemm_helm_args[@]} "
83
+ retry 5 helm " ${aemm_helm_args[@]} "
84
84
set +x
85
85
86
86
TAINT_CHECK_CYCLES=15
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ aemm_helm_args=(
84
84
aemm_helm_args+=(" ${common_helm_args[@]} " )
85
85
86
86
set -x
87
- helm " ${aemm_helm_args[@]} "
87
+ retry 5 helm " ${aemm_helm_args[@]} "
88
88
set +x
89
89
90
90
TAINT_CHECK_CYCLES=15
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ aemm_helm_args=(
84
84
aemm_helm_args+=(" ${common_helm_args[@]} " )
85
85
86
86
set -x
87
- helm " ${aemm_helm_args[@]} "
87
+ retry 5 helm " ${aemm_helm_args[@]} "
88
88
set +x
89
89
90
90
logs=0
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ aemm_helm_args=(
78
78
aemm_helm_args+=(" ${common_helm_args[@]} " )
79
79
80
80
set -x
81
- helm " ${aemm_helm_args[@]} "
81
+ retry 5 helm " ${aemm_helm_args[@]} "
82
82
set +x
83
83
84
84
TAINT_CHECK_CYCLES=15
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ aemm_helm_args=(
86
86
aemm_helm_args+=(" ${common_helm_args[@]} " )
87
87
88
88
set -x
89
- helm " ${aemm_helm_args[@]} "
89
+ retry 5 helm " ${aemm_helm_args[@]} "
90
90
set +x
91
91
92
92
TAINT_CHECK_CYCLES=15
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ common_helm_args=()
20
20
[[ " ${TEST_WINDOWS-} " == " true" ]] && common_helm_args+=(--set targetNodeOs=" windows" )
21
21
[[ -n " ${NTH_WORKER_LABEL-} " ]] && common_helm_args+=(--set nodeSelector." $NTH_WORKER_LABEL " )
22
22
23
+ helm repo add stable https://kubernetes-charts.storage.googleapis.com
24
+ helm repo update
25
+ retry 5 helm install prometheus-operator stable/prometheus-operator --set prometheusOperator.admissionWebhooks.enabled=" false"
26
+
23
27
anth_helm_args=(
24
28
upgrade
25
29
--install
@@ -35,6 +39,7 @@ anth_helm_args=(
35
39
--set enableSpotInterruptionDraining=" true"
36
40
--set taintNode=" true"
37
41
--set enablePrometheusServer=" true"
42
+ --set podMonitor.create=" true"
38
43
--set tolerations=" "
39
44
)
40
45
[[ -n " ${NODE_TERMINATION_HANDLER_DOCKER_PULL_POLICY-} " ]] &&
@@ -80,7 +85,7 @@ aemm_helm_args=(
80
85
aemm_helm_args+=(" ${common_helm_args[@]} " )
81
86
82
87
set -x
83
- helm " ${aemm_helm_args[@]} "
88
+ retry 5 helm " ${aemm_helm_args[@]} "
84
89
set +x
85
90
86
91
TAINT_CHECK_CYCLES=15
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ aemm_helm_args=(
82
82
aemm_helm_args+=(" ${common_helm_args[@]} " )
83
83
84
84
set -x
85
- helm " ${aemm_helm_args[@]} "
85
+ retry 5 helm " ${aemm_helm_args[@]} "
86
86
set +x
87
87
88
88
logs=0
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ aemm_helm_args=(
86
86
aemm_helm_args+=(" ${common_helm_args[@]} " )
87
87
88
88
set -x
89
- helm " ${aemm_helm_args[@]} "
89
+ retry 5 helm " ${aemm_helm_args[@]} "
90
90
set +x
91
91
92
92
TAINT_CHECK_CYCLES=15
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ aemm_helm_args=(
93
93
aemm_helm_args+=(" ${common_helm_args[@]} " )
94
94
95
95
set -x
96
- helm " ${aemm_helm_args[@]} "
96
+ retry 5 helm " ${aemm_helm_args[@]} "
97
97
set +x
98
98
99
99
emtp_helm_args=(
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ aemm_helm_args=(
42
42
aemm_helm_args+=(" ${common_helm_args[@]} " )
43
43
44
44
set -x
45
- helm " ${aemm_helm_args[@]} "
45
+ retry 5 helm " ${aemm_helm_args[@]} "
46
46
set +x
47
47
48
48
emtp_helm_args=(
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ aemm_helm_args=(
83
83
aemm_helm_args+=(" ${common_helm_args[@]} " )
84
84
85
85
set -x
86
- helm " ${aemm_helm_args[@]} "
86
+ retry 5 helm " ${aemm_helm_args[@]} "
87
87
set +x
88
88
89
89
TAINT_CHECK_CYCLES=15
Original file line number Diff line number Diff line change @@ -62,6 +62,31 @@ function exit_and_fail {
62
62
exit 1
63
63
}
64
64
65
+ function retry {
66
+ local retries=$1
67
+ shift
68
+
69
+ local count=0
70
+ set +e
71
+ trap " set -e" RETURN
72
+ until " $@ " ; do
73
+ exit=$?
74
+ set -e
75
+ wait=$(( 2 ** $count ))
76
+ count=$(( $count + 1 ))
77
+ if [ $count -lt $retries ]; then
78
+ echo " Retry $count /$retries exited $exit , retrying in $wait seconds..."
79
+ sleep $wait
80
+ else
81
+ echo " Retry $count /$retries exited $exit , no more retries left."
82
+ return $exit
83
+ fi
84
+ set +e
85
+ done
86
+ return 0
87
+ }
88
+ export -f retry
89
+
65
90
function clean_up {
66
91
if [[ " $PRESERVE " == false ]]; then
67
92
echo " ====================================================================================================="
Original file line number Diff line number Diff line change @@ -95,21 +95,21 @@ if [[ OVERRIDE_PATH -eq 1 ]]; then
95
95
else
96
96
if [ ! -x " $TMP_DIR /kubectl" ]; then
97
97
echoerr " 🥑 Downloading the \" kubectl\" binary"
98
- curl -Lo $TMP_DIR /kubectl " https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION /bin/$PLATFORM /amd64/kubectl"
98
+ retry 5 curl -Lo $TMP_DIR /kubectl " https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION /bin/$PLATFORM /amd64/kubectl"
99
99
chmod +x $TMP_DIR /kubectl
100
100
echoerr " 👍 Downloaded the \" kubectl\" binary"
101
101
fi
102
102
103
103
if [ ! -x " $TMP_DIR /kind" ]; then
104
104
echoerr " 🥑 Downloading the \" kind\" binary"
105
- curl -Lo $TMP_DIR /kind https://github.com/kubernetes-sigs/kind/releases/download/v$KIND_VERSION /kind-$PLATFORM -amd64
105
+ retry 5 curl -Lo $TMP_DIR /kind https://github.com/kubernetes-sigs/kind/releases/download/v$KIND_VERSION /kind-$PLATFORM -amd64
106
106
chmod +x $TMP_DIR /kind
107
107
echoerr " 👍 Downloaded the \" kind\" binary"
108
108
fi
109
109
110
110
if [ ! -x " $TMP_DIR /helm" ]; then
111
111
echoerr " 🥑 Downloading the \" helm\" binary"
112
- curl -L https://get.helm.sh/helm-v$HELM_VERSION -$PLATFORM -amd64.tar.gz | tar zxf - -C $TMP_DIR
112
+ retry 5 curl -L https://get.helm.sh/helm-v$HELM_VERSION -$PLATFORM -amd64.tar.gz | tar zxf - -C $TMP_DIR
113
113
mv $TMP_DIR /$PLATFORM -amd64/helm $TMP_DIR /.
114
114
chmod +x $TMP_DIR /helm
115
115
echoerr " 👍 Downloaded the \" helm\" binary"
Original file line number Diff line number Diff line change @@ -28,6 +28,31 @@ function relpath() {
28
28
perl -e ' use File::Spec; print File::Spec->abs2rel(@ARGV) . "\n"' $1 $2
29
29
}
30
30
31
+ function retry {
32
+ local retries=$1
33
+ shift
34
+
35
+ local count=0
36
+ set +e
37
+ trap " set -e" RETURN
38
+ until " $@ " ; do
39
+ exit=$?
40
+ set -e
41
+ wait=$(( 2 ** $count ))
42
+ count=$(( $count + 1 ))
43
+ if [ $count -lt $retries ]; then
44
+ echo " Retry $count /$retries exited $exit , retrying in $wait seconds..."
45
+ sleep $wait
46
+ else
47
+ echo " Retry $count /$retries exited $exit , no more retries left."
48
+ return $exit
49
+ fi
50
+ set +e
51
+ done
52
+ return 0
53
+ }
54
+ export -f retry
55
+
31
56
function clean_up {
32
57
if [[ " $PRESERVE " == false ]]; then
33
58
$SCRIPTPATH /../k8s-local-cluster-test/delete-cluster $DELETE_CLUSTER_ARGS || :
You can’t perform that action at this time.
0 commit comments