Merge pull request #82963 from zouyee/unbound

fix docker_build_opts bound variable
This commit is contained in:
Kubernetes Prow Robot 2019-09-25 13:50:20 -07:00 committed by GitHub
commit fa1d4bb767
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
@ -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}"