Skip to content

Commit 1ec822e

Browse files
committed
return code instead of immediately exiting
1 parent ff4b5fc commit 1ec822e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

experiment/compatibility-versions/e2e-k8s-compatibility-versions.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ check_structured_log_support() {
7272
case "${KUBE_VERSION}" in
7373
v1.1[0-8].*)
7474
echo "$1 is only supported on versions >= v1.19, got ${KUBE_VERSION}"
75-
exit 1
75+
return 1
7676
;;
7777
esac
78+
return 0
7879
}
7980

8081
# Function to check if version is greater than or equal to the target
@@ -143,11 +144,11 @@ create_cluster() {
143144
true)
144145
if [ "${feature_gates}" != "{}" ]; then
145146
echo "GA_ONLY=true and FEATURE_GATES=${feature_gates} are mutually exclusive."
146-
exit 1
147+
return 1
147148
fi
148149
if [ "${runtime_config}" != "{}" ]; then
149150
echo "GA_ONLY=true and RUNTIME_CONFIG=${runtime_config} are mutually exclusive."
150-
exit 1
151+
return 1
151152
fi
152153

153154
echo "Limiting to GA APIs and features for ${PREV_VERSION}"
@@ -156,7 +157,7 @@ create_cluster() {
156157
;;
157158
*)
158159
echo "\$GA_ONLY set to '${GA_ONLY}'; supported values are true and false (default)"
159-
exit 1
160+
return 1
160161
;;
161162
esac
162163

@@ -230,6 +231,7 @@ EOF
230231
# Patch kube-proxy to set the verbosity level
231232
kubectl patch -n kube-system daemonset/kube-proxy \
232233
--type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/command/-", "value": "--v='"${KIND_CLUSTER_LOG_LEVEL}"'" }]'
234+
return 0
233235
}
234236

235237
build_prev_version_bins() {
@@ -337,8 +339,9 @@ upgrade_cluster_components() {
337339

338340
if ! "$success"; then
339341
echo "Upgrade failed after $RETRY_ATTEMPTS attempts."
340-
exit 1
342+
return 1
341343
fi
344+
return 0
342345
}
343346

344347
main() {

0 commit comments

Comments
 (0)