From bb2edb20fdc89e3404f1163da03a46f3cb9765fe Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 27 Aug 2014 21:07:56 -0700 Subject: [PATCH] providers/heroku: clean up heroku_app config vars --- builtin/providers/heroku/resource_heroku_app.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/builtin/providers/heroku/resource_heroku_app.go b/builtin/providers/heroku/resource_heroku_app.go index a225982421..275bcaeec3 100644 --- a/builtin/providers/heroku/resource_heroku_app.go +++ b/builtin/providers/heroku/resource_heroku_app.go @@ -155,17 +155,21 @@ func resourceHerokuAppRead(d *schema.ResourceData, meta interface{}) error { } } for k, v := range app.Vars { - if _, ok := care[k]; !ok { + if _, ok := care[k]; ok { configVars[k] = v } } + var configVarsValue []map[string]string + if len(configVars) > 0 { + configVarsValue = []map[string]string{configVars} + } d.Set("name", app.App.Name) d.Set("stack", app.App.Stack.Name) d.Set("region", app.App.Region.Name) d.Set("git_url", app.App.GitURL) d.Set("web_url", app.App.WebURL) - d.Set("config_vars", []map[string]string{configVars}) + d.Set("config_vars", configVarsValue) d.Set("all_config_vars", app.Vars) // We know that the hostname on heroku will be the name+herokuapp.com