Skip to content

Commit 168ec1b

Browse files
committed
ci: enable kubectl retry throughout the test on HAL
Signed-off-by: Yang Chiu <yang.chiu@suse.com>
1 parent 8b133af commit 168ec1b

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

pipelines/utilities/kubectl_retry.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ kubectl() {
88
local delay=5
99
local count=0
1010
11+
for arg in "$@"; do
12+
if [[ "$arg" == "-f" || "$arg" == "-w" || "$arg" == "--follow" || "$arg" == "--watch" ]]; then
13+
/usr/local/bin/kubectl "$@"
14+
return $?
15+
fi
16+
done
17+
1118
while true; do
1219
output=$(/usr/local/bin/kubectl "$@" 2>&1)
1320
exit_code=$?

pipelines/utilities/run_longhorn_e2e_test.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,6 @@ run_longhorn_test(){
141141
kubectl cp /src/longhorn-tests/pipelines/utilities/rancher longhorn-test:/e2e/pipelines/utilities/
142142
fi
143143

144-
if [[ "$LONGHORN_TEST_CLOUDPROVIDER" == "harvester" ]]; then
145-
unset_kubectl_retry
146-
fi
147-
148144
# wait longhorn tests to complete
149145
while [[ "`kubectl get pod longhorn-test -o=jsonpath='{.status.containerStatuses[?(@.name=="longhorn-test")].state}' 2>&1 | grep -v \"terminated\"`" ]]; do
150146
kubectl logs ${LONGHORN_TEST_POD_NAME} -c longhorn-test -f --since=10s

pipelines/utilities/run_longhorn_test.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ run_longhorn_test(){
7474

7575
kubectl wait --for=condition=Ready pod/longhorn-test --timeout=10m
7676

77-
if [[ "$LONGHORN_TEST_CLOUDPROVIDER" == "harvester" ]]; then
78-
unset_kubectl_retry
79-
fi
80-
8177
# wait longhorn tests to complete
8278
while [[ "`kubectl get pod longhorn-test -o=jsonpath='{.status.containerStatuses[?(@.name=="longhorn-test")].state}' 2>&1 | grep -v \"terminated\"`" ]]; do
8379
kubectl logs ${LONGHORN_TEST_POD_NAME} -c longhorn-test -f --since=10s
@@ -210,10 +206,6 @@ run_longhorn_upgrade_test(){
210206

211207
kubectl wait --for=condition=Ready pod/${LONGHORN_UPGRADE_TEST_POD_NAME} --timeout=10m
212208

213-
if [[ "$LONGHORN_TEST_CLOUDPROVIDER" == "harvester" ]]; then
214-
unset_kubectl_retry
215-
fi
216-
217209
# wait upgrade test to complete
218210
while [[ -n "`kubectl get pod ${LONGHORN_UPGRADE_TEST_POD_NAME} -o=jsonpath='{.status.containerStatuses[?(@.name=="longhorn-test")].state}' | grep \"running\"`" ]]; do
219211
kubectl logs ${LONGHORN_UPGRADE_TEST_POD_NAME} -c longhorn-test -f --since=10s

0 commit comments

Comments
 (0)