Skip to content

Commit 884fbf3

Browse files
only pull addon images when it does not exist
1 parent 22e3e79 commit 884fbf3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: build/common.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ readonly GCS_STAGE="${LOCAL_OUTPUT_ROOT}/gcs-stage"
9393
# Get the set of master binaries that run in Docker (on Linux)
9494
# Entry format is "<name-of-binary>,<base-image>".
9595
# Binaries are placed in /usr/local/bin inside the image.
96-
#
96+
#
9797
# $1 - server architecture
9898
kube::build::get_docker_wrapped_binaries() {
9999
case $1 in
@@ -875,7 +875,10 @@ function kube::release::write_addon_docker_images_for_server() {
875875
kube::log::status "Pulling and writing Docker image for addon: ${addon_path}"
876876

877877
local dest_name="${addon_path//\//\~}"
878-
"${DOCKER[@]}" pull "${addon_path}"
878+
if [[ -z $("${DOCKER[@]}" images | awk '{print ($1":"$2)}' | grep "${addon_path}") ]]; then
879+
kube::log::status "Addon image ${addon_path} does not exist, pulling it..."
880+
"${DOCKER[@]}" pull "${addon_path}"
881+
fi
879882
"${DOCKER[@]}" save "${addon_path}" > "${1}/${dest_name}.tar"
880883
) &
881884
done

0 commit comments

Comments
 (0)