From 46a8dfc1917ec91418e3fe314e1617266b9ef530 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 9 Nov 2022 08:05:12 -0800 Subject: [PATCH] Promote container cluster enable_l4_ilb_subsetting from beta to ga (#6767) --- .../resources/resource_container_cluster.go.erb | 12 ------------ .../tests/resource_container_cluster_test.go.erb | 4 ---- 2 files changed, 16 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 45508e6e8d88..b95751b9a596 100644 --- a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb @@ -136,7 +136,6 @@ func rfc5545RecurrenceDiffSuppress(k, o, n string, d *schema.ResourceData) bool return false } -<% unless version == 'ga' -%> // Has enable_l4_ilb_subsetting been enabled before? func isBeenEnabled(_ context.Context, old, new, _ interface{}) bool { if old == nil || new == nil { @@ -150,7 +149,6 @@ func isBeenEnabled(_ context.Context, old, new, _ interface{}) bool { return false } -<% end -%> func resourceContainerCluster() *schema.Resource { return &schema.Resource{ @@ -162,9 +160,7 @@ func resourceContainerCluster() *schema.Resource { CustomizeDiff: customdiff.All( resourceNodeConfigEmptyGuestAccelerator, - <% unless version == 'ga' -%> customdiff.ForceNewIfChange("enable_l4_ilb_subsetting", isBeenEnabled), - <% end -%> containerClusterAutopilotCustomizeDiff, containerClusterNodeVersionRemoveDefaultCustomizeDiff, containerClusterNetworkPolicyEmptyCustomizeDiff, @@ -1689,14 +1685,12 @@ func resourceContainerCluster() *schema.Resource { Description: `Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network.`, ConflictsWith: []string{"enable_autopilot"}, }, -<% unless version == 'ga' -%> "enable_l4_ilb_subsetting": { Type: schema.TypeBool, Optional: true, Description: `Whether L4ILB Subsetting is enabled for this cluster.`, Default: false, }, -<% end -%> "private_ipv6_google_access": { Type: schema.TypeString, Optional: true, @@ -1910,9 +1904,7 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er DefaultSnatStatus: expandDefaultSnatStatus(d.Get("default_snat_status")), DatapathProvider: d.Get("datapath_provider").(string), PrivateIpv6GoogleAccess: d.Get("private_ipv6_google_access").(string), - <% unless version == 'ga' -%> EnableL4ilbSubsetting: d.Get("enable_l4_ilb_subsetting").(bool), - <% end -%> DnsConfig: expandDnsConfig(d.Get("dns_config")), }, MasterAuth: expandMasterAuth(d.Get("master_auth")), @@ -2307,11 +2299,9 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro if err := d.Set("notification_config", flattenNotificationConfig(cluster.NotificationConfig)); err != nil { return err } -<% unless version == 'ga' -%> if err := d.Set("enable_l4_ilb_subsetting", cluster.NetworkConfig.EnableL4ilbSubsetting); err != nil { return fmt.Errorf("Error setting enable_l4_ilb_subsetting: %s", err) } -<% end -%> if err := d.Set("cost_management_config", flattenManagementConfig(cluster.CostManagementConfig)); err != nil { return fmt.Errorf("Error setting cost_management_config: %s", err) } @@ -2695,7 +2685,6 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er log.Printf("[INFO] GKE cluster %s Private IPv6 Google Access has been updated", d.Id()) } -<% unless version == 'ga' -%> if d.HasChange("enable_l4_ilb_subsetting") { // This field can be changed from false to true but not from false to true. CustomizeDiff handles that check. enabled := d.Get("enable_l4_ilb_subsetting").(bool) @@ -2732,7 +2721,6 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er log.Printf("[INFO] GKE cluster %s L4 ILB Subsetting has been updated to %v", d.Id(), enabled) } -<% end -%> if d.HasChange("cost_management_config") { c := d.Get("cost_management_config") diff --git a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb index 04bb72036d5e..42cdbd30d974 100644 --- a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb @@ -328,7 +328,6 @@ func TestAccContainerCluster_withConfidentialNodes(t *testing.T) { }) } -<% unless version == 'ga' -%> func TestAccContainerCluster_withILBSubsetting(t *testing.T) { t.Parallel() @@ -367,7 +366,6 @@ func TestAccContainerCluster_withILBSubsetting(t *testing.T) { }, }) } -<% end -%> func TestAccContainerCluster_withMasterAuthConfig_NoCert(t *testing.T) { t.Parallel() @@ -3813,7 +3811,6 @@ resource "google_container_cluster" "confidential_nodes" { `, clusterName, npName) } -<% unless version == 'ga' -%> func testAccContainerCluster_withILBSubSetting(clusterName string, npName string) string { return fmt.Sprintf(` resource "google_container_cluster" "confidential_nodes" { @@ -3857,7 +3854,6 @@ resource "google_container_cluster" "confidential_nodes" { } `, clusterName, npName) } -<% end -%> func testAccContainerCluster_withNetworkPolicyEnabled(clusterName string) string { return fmt.Sprintf(`