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

Commit ebe9ec2

Browse files
author
Marcel Juhnke
committed
also suppress diffs for empty properties from "" to null
1 parent a8785d3 commit ebe9ec2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

vra7/resource_configuration.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func resourceConfigurationSchema(computed bool) *schema.Schema {
2626
Optional: true,
2727
Computed: true,
2828
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
29-
if old != "" && new == "" {
29+
if (old != "" && new == "") || (old == "" && new == "") {
3030
return true
3131
}
3232
return false
@@ -89,10 +89,10 @@ func resourceConfigurationSchema(computed bool) *schema.Schema {
8989
}
9090
}
9191

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

95-
for _, config := range rConfigurations {
95+
for _, config := range rConfigurations.([]interface{}) {
9696
configMap := config.(map[string]interface{})
9797

9898
rConfig := sdk.ResourceConfigurationStruct{

0 commit comments

Comments
 (0)