Skip to content

Commit

Permalink
Promote container cluster enable_l4_ilb_subsetting from beta to ga (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
trodge authored Nov 9, 2022
1 parent 3be660e commit 46a8dfc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -150,7 +149,6 @@ func isBeenEnabled(_ context.Context, old, new, _ interface{}) bool {

return false
}
<% end -%>

func resourceContainerCluster() *schema.Resource {
return &schema.Resource{
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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")),
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ func TestAccContainerCluster_withConfidentialNodes(t *testing.T) {
})
}

<% unless version == 'ga' -%>
func TestAccContainerCluster_withILBSubsetting(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -367,7 +366,6 @@ func TestAccContainerCluster_withILBSubsetting(t *testing.T) {
},
})
}
<% end -%>

func TestAccContainerCluster_withMasterAuthConfig_NoCert(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -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" {
Expand Down Expand Up @@ -3857,7 +3854,6 @@ resource "google_container_cluster" "confidential_nodes" {
}
`, clusterName, npName)
}
<% end -%>

func testAccContainerCluster_withNetworkPolicyEnabled(clusterName string) string {
return fmt.Sprintf(`
Expand Down

0 comments on commit 46a8dfc

Please sign in to comment.