From 8c9b169f170d56f318b5fac244a66d027c6f51d4 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Mon, 1 Apr 2019 17:05:40 -0700 Subject: [PATCH] Fix older bash failing on unbound array variables Older bash versions fail when trying to expand array variables when the array is empty. Signed-off-by: Mrunal Patel --- hack/local-up-cluster.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 91fd135619e..2a1e05e61c0 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -638,7 +638,7 @@ function start_controller_manager { --cluster-signing-cert-file="${CLUSTER_SIGNING_CERT_FILE}" \ --cluster-signing-key-file="${CLUSTER_SIGNING_KEY_FILE}" \ --enable-hostpath-provisioner="${ENABLE_HOSTPATH_PROVISIONER}" \ - "${node_cidr_args[@]}" \ + ${node_cidr_args[@]+"${node_cidr_args[@]}"} \ --pvclaimbinder-sync-period="${CLAIM_BINDER_SYNC_PERIOD}" \ --feature-gates="${FEATURE_GATES}" \ "${cloud_config_arg[@]}" \ @@ -770,13 +770,13 @@ function start_kubelet { "--eviction-pressure-transition-period=${EVICTION_PRESSURE_TRANSITION_PERIOD}" "--pod-manifest-path=${POD_MANIFEST_PATH}" "--fail-swap-on=${FAIL_SWAP_ON}" - "${auth_args[@]}" - "${dns_args[@]}" - "${cni_conf_dir_args[@]}" - "${cni_bin_dir_args[@]}" - "${net_plugin_args[@]}" - "${container_runtime_endpoint_args[@]}" - "${image_service_endpoint_args[@]}" + ${auth_args[@]+"${auth_args[@]}"} + ${dns_args[@]+"${dns_args[@]}"} + ${cni_conf_dir_args[@]+"${cni_conf_dir_args[@]}"} + ${cni_bin_dir_args[@]+"${cni_bin_dir_args[@]}"} + ${net_plugin_args[@]+"${net_plugin_args[@]}"} + ${container_runtime_endpoint_args[@]+"${container_runtime_endpoint_args[@]}"} + ${image_service_endpoint_args[@]+"${image_service_endpoint_args[@]}"} "--port=${KUBELET_PORT}" ${KUBELET_FLAGS} )