diff --git a/Makefile b/Makefile index 7800e891cf..5296ca6b9c 100644 --- a/Makefile +++ b/Makefile @@ -44,4 +44,7 @@ clean: rm -f */requirements.lock -rmdir -p */charts +pull-all-images: + @./tools/pull-images.sh + .PHONY: $(EXCLUDES) $(CHARTS) diff --git a/tools/gate/funcs/common.sh b/tools/gate/funcs/common.sh index 11162c1ee7..c68769fd93 100644 --- a/tools/gate/funcs/common.sh +++ b/tools/gate/funcs/common.sh @@ -65,6 +65,7 @@ function base_install { sudo -H pip install --upgrade pip sudo -H pip install --upgrade setuptools sudo -H pip install pyyaml + sudo -H pip install yq if [ "x$SDN_PLUGIN" == "xlinuxbridge" ]; then sdn_lb_support_install diff --git a/tools/gate/setup_gate.sh b/tools/gate/setup_gate.sh index e423884d6b..b3e0aaae6d 100755 --- a/tools/gate/setup_gate.sh +++ b/tools/gate/setup_gate.sh @@ -60,6 +60,7 @@ if [ "x$INTEGRATION_TYPE" == "xlinter" ]; then helm_plugin_template_install helm_template_run else + cd ${WORK_DIR}; make pull-all-images # Setup the K8s Cluster if [ "x$INTEGRATION" == "xaio" ]; then bash ${WORK_DIR}/tools/gate/kubeadm_aio.sh diff --git a/tools/pull-images.sh b/tools/pull-images.sh new file mode 100755 index 0000000000..49aa6d9571 --- /dev/null +++ b/tools/pull-images.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -x +for CHART_DIR in ./*/ ; do + if [ -e ${CHART_DIR}values.yaml ]; then + for IMAGE in $(cat ${CHART_DIR}values.yaml | yq '.images.tags | map(.) | join(" ")' | tr -d '"'); do + docker inspect $IMAGE >/dev/null|| docker pull $IMAGE + done + fi +done