Skip to content

Commit f51b35f

Browse files
tests: always specify server image name in ad test
When deploying a member server the yaml was inconsistently using both images built for the test run (PR) and images pushed to quay.io. First, make the yaml use one consistent variable name for all images, then force the shell script to explicitly set those vars. Signed-off-by: John Mulligan <[email protected]>
1 parent 0dab2a7 commit f51b35f

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

tests/files/samba-domain-member-pod.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ metadata:
7474
spec:
7575
shareProcessNamespace: true
7676
containers:
77-
- image: samba-server:$IMG_TAG
77+
- image: $IMG_NAME
7878
# Need imagePullPolicy Never for working with local images.
7979
# Otherwise we get "ErrImagePull".
80-
imagePullPolicy: Never
80+
imagePullPolicy: $IMG_PULL_POLICY
8181
name: smb
8282
command:
8383
- "samba-container"
@@ -109,7 +109,8 @@ spec:
109109
name: samba-state-dir
110110
- mountPath: "/run/samba/winbindd"
111111
name: samba-sockets-dir
112-
- image: quay.io/samba.org/samba-server:$IMG_TAG
112+
- image: $IMG_NAME
113+
imagePullPolicy: $IMG_PULL_POLICY
113114
name: winbind
114115
command:
115116
- "samba-container"
@@ -134,7 +135,8 @@ spec:
134135
- mountPath: "/run/samba/winbindd"
135136
name: samba-sockets-dir
136137
initContainers:
137-
- image: quay.io/samba.org/samba-server:$IMG_TAG
138+
- image: $IMG_NAME
139+
imagePullPolicy: $IMG_PULL_POLICY
138140
name: init
139141
args:
140142
- "init"
@@ -154,7 +156,8 @@ spec:
154156
name: samba-container-config
155157
- mountPath: "/var/lib/samba"
156158
name: samba-state-dir
157-
- image: quay.io/samba.org/samba-server:$IMG_TAG
159+
- image: $IMG_NAME
160+
imagePullPolicy: $IMG_PULL_POLICY
158161
name: must-join
159162
args:
160163
- "must-join"

tests/test-deploy-ad-member.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
44
IMG_TAG=${IMG_TAG:-"latest"}
5+
IMG_NAME="${SERVER_IMG:-samba-server}:${IMG_TAG}"
6+
IMG_PULL_POLICY="${IMG_PULL_POLICY:-Never}"
57

68
source "${SCRIPT_DIR}/common.sh"
79

810
echo "Creating ad member pod..."
9-
ERROR_MSG=$(IMG_TAG=${IMG_TAG} envsubst < "${MEMBER_POD_YAML}" | kubectl create -f - 2>&1 1>/dev/null)
11+
ERROR_MSG=$(IMG_NAME="${IMG_NAME}" IMG_PULL_POLICY="${IMG_PULL_POLICY}" envsubst < "${MEMBER_POD_YAML}" | kubectl create -f - 2>&1 1>/dev/null)
1012
if [ $? -ne 0 ] ; then
1113
if [[ "${ERROR_MSG}" =~ "AlreadyExists" ]] ; then
1214
echo "pod exists already. Continuing."

0 commit comments

Comments
 (0)