Skip to content

Commit 085ad21

Browse files
committed
BATS: containers/reset: pre-pull images
Pulling the images could take some time; `kubectl wait` by default only waits for 30 seconds. Make the test more stable by explicitly pulling the relevant image ahead of time, so that is not part of the wait. Signed-off-by: Mark Yen <[email protected]>
1 parent 5bc4392 commit 085ad21

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bats/tests/containers/reset.bats

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ local_setup_file() {
150150
}
151151

152152
@test 'Deploy kubernetes workloads' {
153+
CONTAINERD_NAMESPACE=k8s.io ctrctl image pull --quiet "${IMAGE_NGINX:?}"
153154
kubectl create deployment --replicas 2 --image "${IMAGE_NGINX:?}" bats-nginx
154155
kubectl wait --for=condition=Available deployment/bats-nginx
155156
}
@@ -174,6 +175,7 @@ local_setup_file() {
174175
}
175176

176177
@test 'Re-deploy kubernetes workloads' {
178+
CONTAINERD_NAMESPACE=k8s.io ctrctl image pull --quiet "${IMAGE_NGINX:?}"
177179
kubectl create deployment --replicas 2 --image "${IMAGE_NGINX:?}" bats-nginx
178180
kubectl wait --for=condition=Available deployment/bats-nginx
179181
}

0 commit comments

Comments
 (0)