From 230468d4049a44b83ca9c9261638b3eb1d79069d Mon Sep 17 00:00:00 2001 From: Marcel Wysocki Date: Wed, 28 Aug 2024 14:15:03 +0800 Subject: [PATCH 1/2] Update resource_container_cluster.go.erb Fix autopilot diff suppression func. We only need a diff if a cluster already exists. --- .../services/container/resource_container_cluster.go.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb index e3b59b771e22..0757904fbef0 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb @@ -113,7 +113,9 @@ var ( suppressDiffForAutopilot = schema.SchemaDiffSuppressFunc(func(k, oldValue, newValue string, d *schema.ResourceData) bool { if v, _ := d.Get("enable_autopilot").(bool); v { - return true + / If there is an ID we can safely assume the cluster already exists and return true. + // If there is no ID we don't need to supress any diffs and return false. + return d.Id() != "" } return false }) From b68d1e260ba20e0a8d1aa9b9733c9640e1f240b3 Mon Sep 17 00:00:00 2001 From: Marcel Wysocki Date: Wed, 28 Aug 2024 14:21:18 +0800 Subject: [PATCH 2/2] Update resource_container_cluster.go.erb --- .../services/container/resource_container_cluster.go.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb index 0757904fbef0..8488e2402678 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb @@ -113,7 +113,7 @@ var ( suppressDiffForAutopilot = schema.SchemaDiffSuppressFunc(func(k, oldValue, newValue string, d *schema.ResourceData) bool { if v, _ := d.Get("enable_autopilot").(bool); v { - / If there is an ID we can safely assume the cluster already exists and return true. + // If there is an ID we can safely assume the cluster already exists and return true. // If there is no ID we don't need to supress any diffs and return false. return d.Id() != "" }