Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote container cluster enable_l4_ilb_subsetting from beta to ga #6767

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,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 @@ -149,7 +148,6 @@ func isBeenEnabled(_ context.Context, old, new, _ interface{}) bool {

return false
}
<% end -%>

func resourceContainerCluster() *schema.Resource {
return &schema.Resource{
Expand All @@ -161,9 +159,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 @@ -1563,14 +1559,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 @@ -1784,9 +1778,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 @@ -2181,11 +2173,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 @@ -2569,7 +2559,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 @@ -2606,7 +2595,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 @@ -3764,7 +3762,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 @@ -3808,7 +3805,6 @@ resource "google_container_cluster" "confidential_nodes" {
}
`, clusterName, npName)
}
<% end -%>

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