Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
also suppress diffs for empty properties from "" to null
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Juhnke committed May 4, 2020
1 parent a8785d3 commit ebe9ec2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vra7/resource_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func resourceConfigurationSchema(computed bool) *schema.Schema {
Optional: true,
Computed: true,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if old != "" && new == "" {
if (old != "" && new == "") || (old == "" && new == "") {
return true
}
return false
Expand Down Expand Up @@ -89,10 +89,10 @@ func resourceConfigurationSchema(computed bool) *schema.Schema {
}
}

func expandResourceConfiguration(rConfigurations []interface{}) []sdk.ResourceConfigurationStruct {
configs := make([]sdk.ResourceConfigurationStruct, 0, len(rConfigurations))
func expandResourceConfiguration(rConfigurations interface{}) []sdk.ResourceConfigurationStruct {
configs := make([]sdk.ResourceConfigurationStruct, 0, len(rConfigurations.([]interface{})))

for _, config := range rConfigurations {
for _, config := range rConfigurations.([]interface{}) {
configMap := config.(map[string]interface{})

rConfig := sdk.ResourceConfigurationStruct{
Expand Down

0 comments on commit ebe9ec2

Please sign in to comment.