From b2c74d94209e755fa49187185c7831ccb86e2bc6 Mon Sep 17 00:00:00 2001 From: jiayimeow <136068086+jiayimeow@users.noreply.github.com> Date: Mon, 30 Oct 2023 01:37:58 -0700 Subject: [PATCH] Update resource_container_cluster.go.erb --- .../container/resource_container_cluster.go.erb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 6e38768719a5..53e94ea35295 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 @@ -106,10 +106,12 @@ var ( return false }) - suppressDiffForExsitingFleet = schema.SchemaDiffSuppressFunc(func(k, oldValue, newValue string, d *schema.ResourceData) bool { - o, n := d.GetChange("fleet.0.pre_registered") - log.Printf("[DEBUG] fleet suppress pre_registered old: %v, new: %v\n", o, n) - return o.(bool) + suppressDiffForPreRegisteredFleet = schema.SchemaDiffSuppressFunc(func(k, oldValue, newValue string, d *schema.ResourceData) bool { + if v, _ := d.Get("fleet.0.pre_registered").(bool); v { + log.Printf("[DEBUG] fleet suppress pre_registered: %v\n", v) + return true + } + return false }) )