Skip to content

Commit

Permalink
Merge pull request #82963 from zouyee/unbound
Browse files Browse the repository at this point in the history
fix docker_build_opts bound variable
  • Loading branch information
k8s-ci-robot committed Sep 25, 2019
2 parents f4ff0e3 + e88b81c commit fa1d4bb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions build/lib/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,15 @@ function kube::release::create_docker_images_for_server() {
return 1
fi

# provide `--pull` argument to `docker build` if `KUBE_BUILD_PULL_LATEST_IMAGES`
# is set to y or Y; otherwise try to build the image without forcefully
# pulling the latest base image.
local DOCKER_BUILD_OPTS=()
if [[ "${KUBE_BUILD_PULL_LATEST_IMAGES}" =~ [yY] ]]; then
DOCKER_BUILD_OPTS+=("--pull")
fi
local -r docker_build_opts="${DOCKER_BUILD_OPTS[@]}"

for wrappable in "${binaries[@]}"; do

local oldifs=$IFS
Expand Down Expand Up @@ -375,14 +384,7 @@ EOF
echo "COPY nsswitch.conf /etc/" >> "${docker_file_path}"
fi

# provide `--pull` argument to `docker build` if `KUBE_BUILD_PULL_LATEST_IMAGES`
# is set to y or Y; otherwise try to build the image without forcefully
# pulling the latest base image.
local -a docker_build_opts=()
if [[ "${KUBE_BUILD_PULL_LATEST_IMAGES}" =~ [yY] ]]; then
docker_build_opts+=("--pull")
fi
"${DOCKER[@]}" build "${docker_build_opts[@]}" -q -t "${docker_image_tag}" "${docker_build_path}" >/dev/null
"${DOCKER[@]}" build ${docker_build_opts} -q -t "${docker_image_tag}" "${docker_build_path}" >/dev/null
# If we are building an official/alpha/beta release we want to keep
# docker images and tag them appropriately.
local -r release_docker_image_tag="${KUBE_DOCKER_REGISTRY-$docker_registry}/${binary_name}-${arch}:${KUBE_DOCKER_IMAGE_TAG-$docker_tag}"
Expand Down

0 comments on commit fa1d4bb

Please sign in to comment.