From c89dffb23db032f430b7abb64014ca6a51cfaeef Mon Sep 17 00:00:00 2001 From: Sam Leung Date: Sun, 13 Aug 2023 23:02:56 -0700 Subject: [PATCH] fix label reading (#515) * fix label readding * Update resource_cf_app.go * Update resource_cf_app.go --------- Co-authored-by: Sam Leung --- cloudfoundry/structures_app.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cloudfoundry/structures_app.go b/cloudfoundry/structures_app.go index 879adf093..1a93febaf 100644 --- a/cloudfoundry/structures_app.go +++ b/cloudfoundry/structures_app.go @@ -359,7 +359,12 @@ func AppDeployV3ToResourceData(d *schema.ResourceData, appDeploy v3appdeployers. _ = d.Set("buildpack", bpkg[0]) } } - _ = d.Set(labelsKey, appDeploy.App.Metadata.Labels) + + labels := make(map[string]interface{}) + for labelKey, label := range appDeploy.App.Metadata.Labels { + labels[labelKey] = label.Value + } + _ = d.Set(labelsKey, labels) _ = d.Set("enable_ssh", appDeploy.EnableSSH.Value) _ = d.Set("stopped", appDeploy.App.State == v3Constants.ApplicationStopped)