Skip to content

Commit 8c9b169

Browse files
committed
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 <[email protected]>
1 parent dd96b15 commit 8c9b169

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

hack/local-up-cluster.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ function start_controller_manager {
638638
--cluster-signing-cert-file="${CLUSTER_SIGNING_CERT_FILE}" \
639639
--cluster-signing-key-file="${CLUSTER_SIGNING_KEY_FILE}" \
640640
--enable-hostpath-provisioner="${ENABLE_HOSTPATH_PROVISIONER}" \
641-
"${node_cidr_args[@]}" \
641+
${node_cidr_args[@]+"${node_cidr_args[@]}"} \
642642
--pvclaimbinder-sync-period="${CLAIM_BINDER_SYNC_PERIOD}" \
643643
--feature-gates="${FEATURE_GATES}" \
644644
"${cloud_config_arg[@]}" \
@@ -770,13 +770,13 @@ function start_kubelet {
770770
"--eviction-pressure-transition-period=${EVICTION_PRESSURE_TRANSITION_PERIOD}"
771771
"--pod-manifest-path=${POD_MANIFEST_PATH}"
772772
"--fail-swap-on=${FAIL_SWAP_ON}"
773-
"${auth_args[@]}"
774-
"${dns_args[@]}"
775-
"${cni_conf_dir_args[@]}"
776-
"${cni_bin_dir_args[@]}"
777-
"${net_plugin_args[@]}"
778-
"${container_runtime_endpoint_args[@]}"
779-
"${image_service_endpoint_args[@]}"
773+
${auth_args[@]+"${auth_args[@]}"}
774+
${dns_args[@]+"${dns_args[@]}"}
775+
${cni_conf_dir_args[@]+"${cni_conf_dir_args[@]}"}
776+
${cni_bin_dir_args[@]+"${cni_bin_dir_args[@]}"}
777+
${net_plugin_args[@]+"${net_plugin_args[@]}"}
778+
${container_runtime_endpoint_args[@]+"${container_runtime_endpoint_args[@]}"}
779+
${image_service_endpoint_args[@]+"${image_service_endpoint_args[@]}"}
780780
"--port=${KUBELET_PORT}"
781781
${KUBELET_FLAGS}
782782
)

0 commit comments

Comments
 (0)