Skip to content

Commit 78e89b5

Browse files
abhipatnalaAvinash Patnala
andauthored
Remove ForceNew for enablePrivateNodes (#15747)
Co-authored-by: Avinash Patnala <[email protected]>
1 parent 1ff7250 commit 78e89b5

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

mmv1/third_party/terraform/services/container/resource_container_cluster.go.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,6 @@ func ResourceContainerCluster() *schema.Resource {
20402040
"enable_private_nodes": {
20412041
Type: schema.TypeBool,
20422042
Optional: true,
2043-
ForceNew: true,
20442043
AtLeastOneOf: privateClusterConfigKeys,
20452044
DiffSuppressFunc: containerClusterPrivateClusterConfigSuppress,
20462045
Description: `Enables the private cluster feature, creating a private endpoint on the cluster. In a private cluster, nodes only have RFC 1918 private addresses and communicate with the master's private endpoint via private networking.`,

mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.tmpl

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8416,32 +8416,36 @@ func TestAccContainerCluster_withEnablePrivateEndpointToggle(t *testing.T) {
84168416
subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName)
84178417

84188418
acctest.VcrTest(t, resource.TestCase{
8419-
PreCheck: func() { acctest.AccTestPreCheck(t) },
8419+
PreCheck: func() { acctest.AccTestPreCheck(t) },
84208420
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
8421-
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
8421+
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
84228422
Steps: []resource.TestStep{
84238423
{
84248424
Config: testAccContainerCluster_withEnablePrivateEndpoint(clusterName, "true", networkName, subnetworkName),
84258425
},
84268426
{
8427-
ResourceName: "google_container_cluster.with_enable_private_endpoint",
8428-
ImportState: true,
8429-
ImportStateVerify: true,
8430-
ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"},
8427+
ResourceName: "google_container_cluster.with_enable_private_endpoint",
8428+
ImportState: true,
8429+
ImportStateVerify: true,
8430+
ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"},
84318431
},
84328432
{
84338433
Config: testAccContainerCluster_withEnablePrivateEndpoint(clusterName, "false", networkName, subnetworkName),
8434+
ConfigPlanChecks: resource.ConfigPlanChecks{
8435+
PreApply: []plancheck.PlanCheck{
8436+
plancheck.ExpectResourceAction("google_container_cluster.with_enable_private_endpoint", plancheck.ResourceActionUpdate),
8437+
},
8438+
},
84348439
},
84358440
{
8436-
ResourceName: "google_container_cluster.with_enable_private_endpoint",
8437-
ImportState: true,
8438-
ImportStateVerify: true,
8439-
ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"},
8441+
ResourceName: "google_container_cluster.with_enable_private_endpoint",
8442+
ImportState: true,
8443+
ImportStateVerify: true,
8444+
ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"},
84408445
},
84418446
},
84428447
})
84438448
}
8444-
84458449
func testAccContainerCluster_withEnablePrivateEndpoint(clusterName, flag, networkName, subnetworkName string) string {
84468450
return fmt.Sprintf(`
84478451
data "google_container_engine_versions" "uscentral1a" {

0 commit comments

Comments
 (0)