Commit ecb6d132 authored by Ismo Puustinen's avatar Ismo Puustinen

hack/lib/util.sh: fix empty array expansion with bash 3.

parent 257205d6
...@@ -649,7 +649,9 @@ EOF ...@@ -649,7 +649,9 @@ EOF
# Determines if docker can be run, failures may simply require that the user be added to the docker group. # 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 { function kube::util::ensure_docker_daemon_connectivity {
IFS=" " read -ra DOCKER <<< "${DOCKER_OPTS}" 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 if ! "${DOCKER[@]}" info > /dev/null 2>&1 ; then
cat <<'EOF' >&2 cat <<'EOF' >&2
Can't connect to 'docker' daemon. please fix and retry. Can't connect to 'docker' daemon. please fix and retry.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment