diff --git a/helpers/run-in-test-cluster b/helpers/run-in-test-cluster index 428e9e7..fddaeb3 100755 --- a/helpers/run-in-test-cluster +++ b/helpers/run-in-test-cluster @@ -144,6 +144,10 @@ function update-ccm() { # docker save $IMAGE -o image.tar # run-in-test-cluster # + # When IMAGE_SOURCE=import, the imagePullPolicy is set to Never, + # to ensure the imported image is used and nothing is pulled from + # a registry. + # if [[ "${IMAGE_SOURCE-build}" == "build" ]]; then build-image else @@ -162,6 +166,12 @@ function apply-resources() { | sed "s|https://api.cloudscale.ch|${api_url}|g" \ > /tmp/ccm.yml + if [[ "${IMAGE_SOURCE-build}" == "import" ]]; then + # Ensure the imported image is used, and no image is pulled + # from a remote registry. + sed -i 's|imagePullPolicy: IfNotPresent|imagePullPolicy: Never|g' /tmp/ccm.yml + fi + export KUBECONFIG=k8test/cluster/admin.conf kubectl delete -f /tmp/ccm.yml --ignore-not-found=true kubectl apply -f /tmp/ccm.yml