@@ -201,9 +201,9 @@ func TestAccContainerCluster_withAddons(t *testing.T) {
201
201
pid := envvar.GetTestProjectFromEnv()
202
202
203
203
acctest.VcrTest(t, resource.TestCase{
204
- PreCheck: func() { acctest.AccTestPreCheck(t) },
204
+ PreCheck: func() { acctest.AccTestPreCheck(t) },
205
205
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
206
- CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
206
+ CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
207
207
Steps: []resource.TestStep{
208
208
{
209
209
Config: testAccContainerCluster_withAddons(pid, clusterName, networkName, subnetworkName),
@@ -212,7 +212,6 @@ func TestAccContainerCluster_withAddons(t *testing.T) {
212
212
ResourceName: "google_container_cluster.primary",
213
213
ImportState: true,
214
214
ImportStateVerify: true,
215
- // TODO: clean up this list in `4.0.0`, remove both `workload_identity_config` fields (same for below)
216
215
ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"},
217
216
},
218
217
{
@@ -224,16 +223,15 @@ func TestAccContainerCluster_withAddons(t *testing.T) {
224
223
ImportStateVerify: true,
225
224
ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"},
226
225
},
227
- // Issue with cloudrun_config addon: https://github.com/hashicorp/terraform-provider-google/issues/11943
228
- // {
229
- // Config: testAccContainerCluster_withInternalLoadBalancer(pid, clusterName, networkName, subnetworkName),
230
- // },
231
- // {
232
- // ResourceName: "google_container_cluster.primary",
233
- // ImportState: true,
234
- // ImportStateVerify: true,
235
- // ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"},
236
- // },
226
+ {
227
+ Config: testAccContainerCluster_withInternalLoadBalancer(pid, clusterName, networkName, subnetworkName),
228
+ },
229
+ {
230
+ ResourceName: "google_container_cluster.primary",
231
+ ImportState: true,
232
+ ImportStateVerify: true,
233
+ ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"},
234
+ },
237
235
},
238
236
})
239
237
}
@@ -5793,12 +5791,12 @@ resource "google_container_cluster" "primary" {
5793
5791
gce_persistent_disk_csi_driver_config {
5794
5792
enabled = false
5795
5793
}
5796
- gke_backup_agent_config {
5797
- enabled = false
5798
- }
5799
- config_connector_config {
5800
- enabled = false
5801
- }
5794
+ gke_backup_agent_config {
5795
+ enabled = false
5796
+ }
5797
+ config_connector_config {
5798
+ enabled = false
5799
+ }
5802
5800
gcs_fuse_csi_driver_config {
5803
5801
enabled = false
5804
5802
}
@@ -5818,9 +5816,10 @@ resource "google_container_cluster" "primary" {
5818
5816
}
5819
5817
{{- end }}
5820
5818
}
5821
- deletion_protection = false
5822
5819
network = "%s"
5823
- subnetwork = "%s"
5820
+ subnetwork = "%s"
5821
+
5822
+ deletion_protection = false
5824
5823
}
5825
5824
`, projectID, clusterName, networkName, subnetworkName)
5826
5825
}
@@ -5866,12 +5865,12 @@ resource "google_container_cluster" "primary" {
5866
5865
gce_persistent_disk_csi_driver_config {
5867
5866
enabled = true
5868
5867
}
5869
- gke_backup_agent_config {
5870
- enabled = true
5871
- }
5872
- config_connector_config {
5873
- enabled = true
5874
- }
5868
+ gke_backup_agent_config {
5869
+ enabled = true
5870
+ }
5871
+ config_connector_config {
5872
+ enabled = true
5873
+ }
5875
5874
gcs_fuse_csi_driver_config {
5876
5875
enabled = true
5877
5876
}
@@ -5897,52 +5896,53 @@ resource "google_container_cluster" "primary" {
5897
5896
}
5898
5897
{{- end }}
5899
5898
}
5900
- deletion_protection = false
5901
5899
network = "%s"
5902
- subnetwork = "%s"
5900
+ subnetwork = "%s"
5901
+
5902
+ deletion_protection = false
5903
5903
}
5904
5904
`, projectID, clusterName, networkName, subnetworkName)
5905
5905
}
5906
5906
5907
- // Issue with cloudrun_config addon: https://github.com/hashicorp/terraform-provider-google/issues/11943/
5908
- // func testAccContainerCluster_withInternalLoadBalancer(projectID string, clusterName, networkName, subnetworkName string) string {
5909
- // return fmt.Sprintf(`
5910
- // data "google_project" "project" {
5911
- // project_id = "%s"
5912
- // }
5913
-
5914
- // resource "google_container_cluster" "primary" {
5915
- // name = "%s "
5916
- // location = "us-central1-a"
5917
- // initial_node_count = 1
5918
-
5919
- // min_master_version = "latest"
5920
-
5921
- // workload_identity_config {
5922
- // workload_pool = "${data.google_project.project.project_id}.svc.id.goog"
5923
- // }
5924
-
5925
- // addons_config {
5926
- // http_load_balancing {
5927
- // disabled = false
5928
- // }
5929
- // horizontal_pod_autoscaling {
5930
- // disabled = false
5931
- // }
5932
- // network_policy_config {
5933
- // disabled = false
5934
- // }
5935
- // cloudrun_config {
5936
- // disabled = false
5937
- // load_balancer_type = "LOAD_BALANCER_TYPE_INTERNAL"
5938
- // }
5939
- // }
5940
- // deletion_protection = false
5941
- // network = "%s"
5942
- // subnetwork = "%s"
5943
- // }
5944
- // `, projectID, clusterName, networkName, subnetworkName)
5945
- // }
5907
+ func testAccContainerCluster_withInternalLoadBalancer(projectID string, clusterName, networkName, subnetworkName string) string {
5908
+ return fmt.Sprintf(`
5909
+ data "google_project" "project" {
5910
+ project_id = "%s"
5911
+ }
5912
+
5913
+ resource "google_container_cluster" "primary" {
5914
+ name = "%s"
5915
+ location = "us-central1-a "
5916
+ initial_node_count = 1
5917
+
5918
+ min_master_version = "latest"
5919
+
5920
+ workload_identity_config {
5921
+ workload_pool = "${data.google_project.project.project_id}.svc.id.goog"
5922
+ }
5923
+
5924
+ addons_config {
5925
+ http_load_balancing {
5926
+ disabled = false
5927
+ }
5928
+ horizontal_pod_autoscaling {
5929
+ disabled = false
5930
+ }
5931
+ network_policy_config {
5932
+ disabled = false
5933
+ }
5934
+ cloudrun_config {
5935
+ disabled = false
5936
+ load_balancer_type = "LOAD_BALANCER_TYPE_INTERNAL"
5937
+ }
5938
+ }
5939
+ network = "%s"
5940
+ subnetwork = "%s"
5941
+
5942
+ deletion_protection = false
5943
+ }
5944
+ `, projectID, clusterName, networkName, subnetworkName)
5945
+ }
5946
5946
5947
5947
func testAccContainerCluster_withNotificationConfig(clusterName, topic, networkName, subnetworkName string) string {
5948
5948
return fmt.Sprintf(`
0 commit comments