diff --git a/digitalocean/database/resource_database_cluster.go b/digitalocean/database/resource_database_cluster.go index dbebba79f..d6082fe98 100644 --- a/digitalocean/database/resource_database_cluster.go +++ b/digitalocean/database/resource_database_cluster.go @@ -104,9 +104,12 @@ func ResourceDigitalOceanDatabaseCluster() *schema.Resource { // Prevent a diff when seconds in response, e.g: "13:00" -> "13:00:00" DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { newSplit := strings.Split(new, ":") + oldSplit := strings.Split(old, ":") if len(newSplit) == 3 { - newTrimed := strings.Join(newSplit[:2], ":") - return newTrimed == old + new = strings.Join(newSplit[:2], ":") + } + if len(oldSplit) == 3 { + old = strings.Join(oldSplit[:2], ":") } return old == new }, diff --git a/digitalocean/database/resource_database_cluster_test.go b/digitalocean/database/resource_database_cluster_test.go index 83864a20f..d053701a8 100644 --- a/digitalocean/database/resource_database_cluster_test.go +++ b/digitalocean/database/resource_database_cluster_test.go @@ -781,7 +781,7 @@ resource "digitalocean_database_cluster" "foobar" { maintenance_window { day = "friday" - hour = "13:00:00" + hour = "13:00" } }`