diff --git a/go.mod b/go.mod index 6883058da..fcfd41e69 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( github.com/go-openapi/strfmt v0.20.1 github.com/google/uuid v1.2.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 - github.com/hashicorp/go-version v1.3.0 github.com/hashicorp/hcl/v2 v2.8.2 // indirect github.com/hashicorp/hcp-sdk-go v0.10.0 github.com/hashicorp/terraform-exec v0.13.3 // indirect diff --git a/internal/provider/resource_consul_cluster.go b/internal/provider/resource_consul_cluster.go index e11ca00ec..4cb7e9328 100644 --- a/internal/provider/resource_consul_cluster.go +++ b/internal/provider/resource_consul_cluster.go @@ -7,7 +7,6 @@ import ( "strings" "time" - "github.com/hashicorp/go-version" consulmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-consul-service/preview/2021-02-04/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -95,12 +94,7 @@ func resourceConsulCluster() *schema.Resource { DiffSuppressFunc: func(_, old, new string, _ *schema.ResourceData) bool { // Suppress diff is normalized versions match OR min_consul_version is removed from the resource // since min_consul_version is required in order to upgrade the cluster to a new Consul version. - actualConsulVersion := version.Must(version.NewVersion(old)) - currentTFVersion := version.Must(version.NewVersion(new)) - log.Printf("[DEBUG] Actual Consul Version %v", old) - log.Printf("[DEBUG] Current TF Version %v", new) - - return currentTFVersion.LessThanOrEqual(actualConsulVersion) || new == "" + return input.NormalizeVersion(old) == input.NormalizeVersion(new) || new == "" }, }, "datacenter": { @@ -467,10 +461,6 @@ func setConsulClusterResourceData(d *schema.ResourceData, cluster *consulmodels. return err } - if err := d.Set("min_consul_version", cluster.ConsulVersion); err != nil { - return err - } - if err := d.Set("auto_hvn_to_hvn_peering", cluster.Config.AutoHvnToHvnPeering); err != nil { return err }