diff --git a/cluster-autoscaler/cloudprovider/gce/templates.go b/cluster-autoscaler/cloudprovider/gce/templates.go index a270b22b926d..866766e0cc98 100644 --- a/cluster-autoscaler/cloudprovider/gce/templates.go +++ b/cluster-autoscaler/cloudprovider/gce/templates.go @@ -420,6 +420,8 @@ func extractAutoscalerVarFromKubeEnv(kubeEnv, name string) ([]string, error) { func extractFromKubeEnv(kubeEnv, resource string) ([]string, error) { result := make([]string, 0) + kubeEnv = strings.Replace(kubeEnv, "\n ", " ", -1) + for line, env := range strings.Split(kubeEnv, "\n") { env = strings.Trim(env, " ") if len(env) == 0 {