diff --git a/cluster/gce/container-linux/configure-helper.sh b/cluster/gce/container-linux/configure-helper.sh index 4b7857387d..439e12fca8 100755 --- a/cluster/gce/container-linux/configure-helper.sh +++ b/cluster/gce/container-linux/configure-helper.sh @@ -215,14 +215,19 @@ EOF if [[ -n "${NODE_INSTANCE_PREFIX:-}" ]]; then use_cloud_config="true" if [[ -n "${NODE_TAGS:-}" ]]; then - local -r node_tags="${NODE_TAGS}" + # split NODE_TAGS into an array by comma. + IFS=',' read -r -a node_tags <<< ${NODE_TAGS} else local -r node_tags="${NODE_INSTANCE_PREFIX}" fi cat <>/etc/gce.conf -node-tags = ${node_tags} node-instance-prefix = ${NODE_INSTANCE_PREFIX} EOF + for tag in ${node_tags[@]}; do + cat <>/etc/gce.conf +node-tags = ${tag} +EOF + done fi if [[ -n "${MULTIZONE:-}" ]]; then use_cloud_config="true" @@ -232,9 +237,13 @@ EOF fi if [[ -n "${GCE_ALPHA_FEATURES:-}" ]]; then use_cloud_config="true" - cat <>/etc/gce.conf -alpha-features = ${GCE_ALPHA_FEATURES} + # split GCE_ALPHA_FEATURES into an array by comma. + IFS=',' read -r -a alpha_features <<< ${GCE_ALPHA_FEATURES} + for feature in ${alpha_features[@]}; do + cat <>/etc/gce.conf +alpha-features = ${feature} EOF + done fi if [[ -n "${SECONDARY_RANGE_NAME:-}" ]]; then use_cloud_config="true" diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index a165c79586..4efa432a11 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -583,14 +583,19 @@ EOF if [[ -n "${NODE_INSTANCE_PREFIX:-}" ]]; then use_cloud_config="true" if [[ -n "${NODE_TAGS:-}" ]]; then - local -r node_tags="${NODE_TAGS}" + # split NODE_TAGS into an array by comma. + IFS=',' read -r -a node_tags <<< ${NODE_TAGS} else local -r node_tags="${NODE_INSTANCE_PREFIX}" fi cat <>/etc/gce.conf -node-tags = ${node_tags} node-instance-prefix = ${NODE_INSTANCE_PREFIX} EOF + for tag in ${node_tags[@]}; do + cat <>/etc/gce.conf +node-tags = ${tag} +EOF + done fi if [[ -n "${MULTIZONE:-}" ]]; then use_cloud_config="true" @@ -600,9 +605,13 @@ EOF fi if [[ -n "${GCE_ALPHA_FEATURES:-}" ]]; then use_cloud_config="true" - cat <>/etc/gce.conf -alpha-features = ${GCE_ALPHA_FEATURES} + # split GCE_ALPHA_FEATURES into an array by comma. + IFS=',' read -r -a alpha_features <<< ${GCE_ALPHA_FEATURES} + for feature in ${alpha_features[@]}; do + cat <>/etc/gce.conf +alpha-features = ${feature} EOF + done fi if [[ -n "${SECONDARY_RANGE_NAME:-}" ]]; then use_cloud_config="true" diff --git a/pkg/cloudprovider/providers/gce/gce.go b/pkg/cloudprovider/providers/gce/gce.go index d1cb109271..8447092f16 100644 --- a/pkg/cloudprovider/providers/gce/gce.go +++ b/pkg/cloudprovider/providers/gce/gce.go @@ -149,6 +149,7 @@ type GCECloud struct { AlphaFeatureGate *AlphaFeatureGate } +// TODO: replace gcfg with json type ConfigGlobal struct { TokenURL string `gcfg:"token-url"` TokenBody string `gcfg:"token-body"` @@ -173,7 +174,7 @@ type ConfigGlobal struct { // located in (i.e. where the controller will be running). If this is // blank, then the local zone will be discovered via the metadata server. LocalZone string `gcfg:"local-zone"` - // Possible values: List of api names separated by comma. Default to none. + // Default to none. // For example: MyFeatureFlag AlphaFeatures []string `gcfg:"alpha-features"` }