Merge pull request #74970 from ipuustin/lib-util-sh-2

hack/lib/util.sh: fix empty array expansion with bash 3.
pull/564/head
Kubernetes Prow Robot 2019-03-06 02:08:33 -08:00 committed by GitHub
commit a7346b60bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -649,7 +649,9 @@ EOF
# Determines if docker can be run, failures may simply require that the user be added to the docker group.
function kube::util::ensure_docker_daemon_connectivity {
IFS=" " read -ra DOCKER <<< "${DOCKER_OPTS}"
DOCKER=(docker "${DOCKER[@]}")
# Expand ${DOCKER[@]} only if it's not unset. This is to work around
# Bash 3 issue with unbound variable.
DOCKER=(docker ${DOCKER[@]:+"${DOCKER[@]}"})
if ! "${DOCKER[@]}" info > /dev/null 2>&1 ; then
cat <<'EOF' >&2
Can't connect to 'docker' daemon. please fix and retry.