From dda5e49caca448941bf57c94b96d069e74fa9ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Osipiuk?= Date: Mon, 27 May 2019 14:45:34 +0200 Subject: [PATCH] Split CA parameters on manifest template expansion Split arguments to be passed to cluster autoscaler binary, so each argument is passed separately. This is preparatory work for migrating CA to disroless base image and passing multiple arguments together does not work if CA is not wrapped around with shell script Change-Id: I26b5a764d2a12079c7f4ed6633ccabf8d623e232 --- cluster/gce/gci/configure-helper.sh | 8 +++++++- cluster/gce/manifests/cluster-autoscaler.manifest | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 37190119ef..f32fbf45c9 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -2164,7 +2164,13 @@ function start-cluster-autoscaler { local params="${AUTOSCALER_MIG_CONFIG} ${CLOUD_CONFIG_OPT} ${AUTOSCALER_EXPANDER_CONFIG:---expander=price}" params+=" --kubeconfig=/etc/srv/kubernetes/cluster-autoscaler/kubeconfig" - sed -i -e "s@{{params}}@${params}@g" "${src_file}" + + # split the params into separate arguments passed to binary + local params_split + params_split=$(eval "for param in $params; do echo -n \\\"\$param\\\",; done") + params_split=${params_split%?} + + sed -i -e "s@{{params}}@${params_split}@g" "${src_file}" sed -i -e "s@{{cloud_config_mount}}@${CLOUD_CONFIG_MOUNT}@g" "${src_file}" sed -i -e "s@{{cloud_config_volume}}@${CLOUD_CONFIG_VOLUME}@g" "${src_file}" sed -i -e "s@{%.*%}@@g" "${src_file}" diff --git a/cluster/gce/manifests/cluster-autoscaler.manifest b/cluster/gce/manifests/cluster-autoscaler.manifest index ad199fc51b..db4a2926d3 100644 --- a/cluster/gce/manifests/cluster-autoscaler.manifest +++ b/cluster/gce/manifests/cluster-autoscaler.manifest @@ -34,7 +34,7 @@ "--write-status-configmap=true", "--balance-similar-node-groups=true", "--expendable-pods-priority-cutoff=-10", - "{{params}}" + {{params}} ], "env": [ {