Skip to content

Commit 173b964

Browse files
committed
Do not update in function ct_pull_or_import_postgresql
globally. Some functions needs to have original version. Create a local NEW_VERSION for each function rather Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent 4f3123a commit 173b964

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/test-lib-python.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ source "${THISDIR}/test-lib.sh"
1212
source "${THISDIR}/test-lib-openshift.sh"
1313

1414
function ct_pull_or_import_postgresql() {
15-
if [[ "${VERSION}" == *"minimal"* ]]; then
16-
VERSION=$(echo "${VERSION}" | cut -d "-" -f 1)
17-
fi
18-
if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]]; then
15+
if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]] || [[ "${VERSION}" == "3.12-minimal" ]]; then
1916
postgresql_image="quay.io/sclorg/postgresql-12-c8s"
2017
image_short="postgresql:12"
2118
image_tag="${image_short}"
@@ -46,8 +43,9 @@ function test_python_imagestream() {
4643
elif [ "${OS}" == "rhel10" ]; then
4744
tag="-ubi10"
4845
fi
46+
4947
# On RHEL10 we have only 3.12-minimal image
50-
if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]] && [[ "${VERSION}" == "3.12-minimal" ]]; then
48+
if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]] || [[ "${VERSION}" == "3.12-minimal" ]]; then
5149
branch="4.2.x"
5250
postgresql_image="quay.io/sclorg/postgresql-12-c8s|postgresql:12"
5351
postgresql_version="12"
@@ -78,10 +76,11 @@ function test_python_s2i_app_ex_standalone() {
7876
}
7977

8078
function test_python_s2i_app_ex() {
79+
local NEW_VERSION="${VERSION}"
8180
if [[ "${VERSION}" == *"minimal"* ]]; then
82-
VERSION=$(echo "${VERSION}" | cut -d "-" -f 1)
81+
NEW_VERSION=$(echo "${VERSION}" | cut -d "-" -f 1)
8382
fi
84-
if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]]; then
83+
if [[ "${NEW_VERSION}" == "3.11" ]] || [[ "${NEW_VERSION}" == "3.12" ]] || [[ "${NEW_VERSION}" == "3.12-minimal" ]]; then
8584
branch="4.2.x"
8685
else
8786
branch="2.2.x"
@@ -101,10 +100,11 @@ function test_python_s2i_templates() {
101100
django-postgresql.json \
102101
django-postgresql-persistent.json"
103102
fi
103+
local NEW_VERSION="${VERSION}"
104104
if [[ "${VERSION}" == *"minimal"* ]]; then
105-
VERSION=$(echo "${VERSION}" | cut -d "-" -f 1)
105+
NEW_VERSION=$(echo "${VERSION}" | cut -d "-" -f 1)
106106
fi
107-
if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]]; then
107+
if [[ "${NEW_VERSION}" == "3.11" ]] || [[ "${NEW_VERSION}" == "3.12" ]]; then
108108
postgresql_image="quay.io/sclorg/postgresql-12-c8s|postgresql:12"
109109
postgresql_version="12"
110110
branch="4.2.x"
@@ -119,7 +119,7 @@ django-postgresql-persistent.json"
119119
"https://raw.githubusercontent.com/sclorg/django-ex/${branch}/openshift/templates/${template}" \
120120
python \
121121
'Welcome to your Django application on OpenShift' \
122-
8080 http 200 "-p SOURCE_REPOSITORY_REF=$branch -p PYTHON_VERSION=${VERSION} -p POSTGRESQL_VERSION=${postgresql_version} -p NAME=python-testing" \
122+
8080 http 200 "-p SOURCE_REPOSITORY_REF=$branch -p PYTHON_VERSION=${NEW_VERSION} -p POSTGRESQL_VERSION=${postgresql_version} -p NAME=python-testing" \
123123
"${postgresql_image}"
124124
done
125125
}

0 commit comments

Comments
 (0)