Skip to content

Commit

Permalink
fix label reading (cloudfoundry-community#515)
Browse files Browse the repository at this point in the history
* fix label readding

* Update resource_cf_app.go

* Update resource_cf_app.go

---------

Co-authored-by: Sam Leung <[email protected]>
  • Loading branch information
sleungcy and sleungcy-sap authored Aug 14, 2023
1 parent 217682b commit c89dffb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cloudfoundry/structures_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c89dffb

Please sign in to comment.