From e13a2413a79404b241e393db53f1557b4d46d870 Mon Sep 17 00:00:00 2001 From: Cameron Thornton Date: Tue, 2 Mar 2021 16:44:10 -0600 Subject: [PATCH 1/2] Remove release channel UNSPECIFIED diff suppress --- .../terraform/resources/resource_container_cluster.go.erb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb index d0f53829a594..1a7ae1321cf2 100644 --- a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb @@ -1103,7 +1103,6 @@ func resourceContainerCluster() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{"UNSPECIFIED", "RAPID", "REGULAR", "STABLE"}, false), - DiffSuppressFunc: emptyOrDefaultStringSuppress("UNSPECIFIED"), Description: `The selected release channel. Accepted values are: * UNSPECIFIED: Not set. * RAPID: Weekly upgrade cadence; Early testers and developers who requires new features. @@ -3514,12 +3513,12 @@ func flattenVerticalPodAutoscaling(c *containerBeta.VerticalPodAutoscaling) []ma func flattenReleaseChannel(c *containerBeta.ReleaseChannel) []map[string]interface{} { result := []map[string]interface{}{} - if c != nil { + if c != nil && c.Channel != "" { result = append(result, map[string]interface{}{ "channel": c.Channel, }) } else { - // Explicitly set the release channel to the default. + // Explicitly set the release channel to the UNSPECIFIED. result = append(result, map[string]interface{}{ "channel": "UNSPECIFIED", }) From 37b5d5023c184766c267f1487027396c7ce14170 Mon Sep 17 00:00:00 2001 From: Cameron Thornton Date: Tue, 2 Mar 2021 17:39:02 -0600 Subject: [PATCH 2/2] Fix TestAccContainerNodePool_withManagement --- .../terraform/tests/resource_container_node_pool_test.go.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mmv1/third_party/terraform/tests/resource_container_node_pool_test.go.erb b/mmv1/third_party/terraform/tests/resource_container_node_pool_test.go.erb index c97cbce0274b..0c9647bb7d38 100644 --- a/mmv1/third_party/terraform/tests/resource_container_node_pool_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_container_node_pool_test.go.erb @@ -1183,6 +1183,9 @@ resource "google_container_cluster" "cluster" { name = "%s" location = "us-central1-a" initial_node_count = 1 + release_channel { + channel = "UNSPECIFIED" + } } resource "google_container_node_pool" "np_with_management" {