Skip to content

Commit 65aed92

Browse files
committed
RHOAIENG-20088: chore(ci/check-params-env.sh|check-runtime-images.sh)
Assure that when the expected image size variable isn't defined or is zero, then the execution fails with some decent message.
1 parent 97479e0 commit 65aed92

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ci/check-params-env.sh

+5
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ function check_image_variable_matches_name_and_commitref_and_size() {
249249
}
250250

251251
# Check the size change constraints now
252+
if test -z "${expected_img_size}" || test "${expected_img_size}" -eq 0; then
253+
echo "Expected image size is undefined or empty, please check the pre-defined values!"
254+
return 1
255+
fi
256+
252257
# 1. Percentual size change
253258
percent_change=$((100 * actual_img_size / expected_img_size - 100))
254259
abs_percent_change=${percent_change#-*}

ci/check-runtime-images.sh

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ function check_image_size() {
5858
esac
5959

6060
# Check the size change constraints now
61+
if test -z "${expected_img_size}" || test "${expected_img_size}" -eq 0; then
62+
echo "Expected image size is undefined or empty, please check the pre-defined values!"
63+
return 1
64+
fi
65+
6166
# 1. Percentual size change
6267
percent_change=$((100 * actual_img_size / expected_img_size - 100))
6368
abs_percent_change=${percent_change#-*}

0 commit comments

Comments
 (0)