Skip to content

Commit 236ade0

Browse files
committed
Properly quote flags passed to Cluster Autoscaler
In the current implementation, the flags are not put between quotes, and so the Cluster Autoscaler manifest doesn't parse as valid JSON.
1 parent e39bdd4 commit 236ade0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cluster/gce/gci/configure-helper.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,12 +2148,14 @@ function start-cluster-autoscaler {
21482148
# Remove salt comments and replace variables with values
21492149
local -r src_file="${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty/cluster-autoscaler.manifest"
21502150

2151-
local params=("${AUTOSCALER_MIG_CONFIG}" "${CLOUD_CONFIG_OPT}" "${AUTOSCALER_EXPANDER_CONFIG:---expander=price}")
2151+
local params
2152+
read -r -a params <<< "${AUTOSCALER_MIG_CONFIG}"
2153+
params+=("${CLOUD_CONFIG_OPT}" "${AUTOSCALER_EXPANDER_CONFIG:---expander=price}")
21522154
params+=("--kubeconfig=/etc/srv/kubernetes/cluster-autoscaler/kubeconfig")
21532155

21542156
# split the params into separate arguments passed to binary
21552157
local params_split
2156-
params_split=$(eval 'for param in "${params[@]}"; do echo -n "$param",; done')
2158+
params_split=$(eval 'for param in "${params[@]}"; do echo -n \""$param"\",; done')
21572159
params_split=${params_split%?}
21582160

21592161
sed -i -e "s@{{params}}@${params_split}@g" "${src_file}"

0 commit comments

Comments
 (0)