Skip to content

Commit a2a3d22

Browse files
slevenickamanMahendroo
authored andcommitted
Force send internal_ip_only (GoogleCloudPlatform#11923)
1 parent 3299b72 commit a2a3d22

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster.go

+1
Original file line numberDiff line numberDiff line change
@@ -2177,6 +2177,7 @@ func expandGceClusterConfig(d *schema.ResourceData, config *transport_tpg.Config
21772177
}
21782178
if v, ok := cfg["internal_ip_only"]; ok {
21792179
conf.InternalIpOnly = v.(bool)
2180+
conf.ForceSendFields = append(conf.ForceSendFields, "InternalIpOnly")
21802181
}
21812182
if v, ok := cfg["metadata"]; ok {
21822183
conf.Metadata = tpgresource.ConvertStringMap(v.(map[string]interface{}))

mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go.tmpl

+18-10
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestAccDataprocCluster_missingZoneGlobalRegion1(t *testing.T) {
2828

2929
rnd := acctest.RandString(t, 10)
3030
acctest.VcrTest(t, resource.TestCase{
31-
PreCheck: func() { acctest.AccTestPreCheck(t) },
31+
PreCheck: func() { acctest.AccTestPreCheck(t) },
3232
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
3333
Steps: []resource.TestStep{
3434
{
@@ -44,7 +44,7 @@ func TestAccDataprocCluster_missingZoneGlobalRegion2(t *testing.T) {
4444

4545
rnd := acctest.RandString(t, 10)
4646
acctest.VcrTest(t, resource.TestCase{
47-
PreCheck: func() { acctest.AccTestPreCheck(t) },
47+
PreCheck: func() { acctest.AccTestPreCheck(t) },
4848
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
4949
Steps: []resource.TestStep{
5050
{
@@ -559,7 +559,6 @@ func TestAccDataprocCluster_spotWithAuxiliaryNodeGroups(t *testing.T) {
559559
resource.TestCheckResourceAttr("google_dataproc_cluster.with_auxiliary_node_groups", "cluster_config.0.auxiliary_node_groups.0.node_group.0.node_group_config.0.accelerators.0.accelerator_count", "1"),
560560
resource.TestCheckResourceAttr("google_dataproc_cluster.with_auxiliary_node_groups", "cluster_config.0.auxiliary_node_groups.0.node_group_id", "node-group-id"),
561561
testAccCheckDataprocAuxiliaryNodeGroupAccelerator(&cluster, project),
562-
563562
),
564563
},
565564
},
@@ -707,7 +706,7 @@ func TestAccDataprocCluster_withServiceAcc(t *testing.T) {
707706
ExternalProviders: map[string]resource.ExternalProvider{
708707
"time": {},
709708
},
710-
CheckDestroy: testAccCheckDataprocClusterDestroy(t),
709+
CheckDestroy: testAccCheckDataprocClusterDestroy(t),
711710
Steps: []resource.TestStep{
712711
{
713712
Config: testAccDataprocCluster_withServiceAcc(sa, rnd, subnetworkName),
@@ -827,13 +826,13 @@ func TestAccDataprocCluster_withLifecycleConfigAutoDeletion(t *testing.T) {
827826
CheckDestroy: testAccCheckDataprocClusterDestroy(t),
828827
Steps: []resource.TestStep{
829828
{
830-
Config: testAccDataprocCluster_withLifecycleConfigAutoDeletionTime(rnd, now.Add(time.Hour * 10).Format(fmtString), subnetworkName),
829+
Config: testAccDataprocCluster_withLifecycleConfigAutoDeletionTime(rnd, now.Add(time.Hour*10).Format(fmtString), subnetworkName),
831830
Check: resource.ComposeTestCheckFunc(
832831
testAccCheckDataprocClusterExists(t, "google_dataproc_cluster.with_lifecycle_config", &cluster),
833832
),
834833
},
835834
{
836-
Config: testAccDataprocCluster_withLifecycleConfigAutoDeletionTime(rnd, now.Add(time.Hour * 20).Format(fmtString), subnetworkName),
835+
Config: testAccDataprocCluster_withLifecycleConfigAutoDeletionTime(rnd, now.Add(time.Hour*20).Format(fmtString), subnetworkName),
837836
Check: resource.ComposeTestCheckFunc(
838837
testAccCheckDataprocClusterExists(t, "google_dataproc_cluster.with_lifecycle_config", &cluster),
839838
),
@@ -1046,7 +1045,7 @@ func TestAccDataprocCluster_withMetastoreConfig(t *testing.T) {
10461045
updateServiceId := "tf-test-metastore-srv-update-" + acctest.RandString(t, 10)
10471046
msName_basic := fmt.Sprintf("projects/%s/locations/us-central1/services/%s", pid, basicServiceId)
10481047
msName_update := fmt.Sprintf("projects/%s/locations/us-central1/services/%s", pid, updateServiceId)
1049-
1048+
10501049
var cluster dataproc.Cluster
10511050
clusterName := "tf-test-" + acctest.RandString(t, 10)
10521051
acctest.VcrTest(t, resource.TestCase{
@@ -1058,16 +1057,14 @@ func TestAccDataprocCluster_withMetastoreConfig(t *testing.T) {
10581057
Config: testAccDataprocCluster_withMetastoreConfig(clusterName, basicServiceId),
10591058
Check: resource.ComposeTestCheckFunc(
10601059
testAccCheckDataprocClusterExists(t, "google_dataproc_cluster.with_metastore_config", &cluster),
1061-
resource.TestCheckResourceAttr("google_dataproc_cluster.with_metastore_config", "cluster_config.0.metastore_config.0.dataproc_metastore_service",msName_basic),
1062-
1060+
resource.TestCheckResourceAttr("google_dataproc_cluster.with_metastore_config", "cluster_config.0.metastore_config.0.dataproc_metastore_service", msName_basic),
10631061
),
10641062
},
10651063
{
10661064
Config: testAccDataprocCluster_withMetastoreConfig_update(clusterName, updateServiceId),
10671065
Check: resource.ComposeTestCheckFunc(
10681066
testAccCheckDataprocClusterExists(t, "google_dataproc_cluster.with_metastore_config", &cluster),
10691067
resource.TestCheckResourceAttr("google_dataproc_cluster.with_metastore_config", "cluster_config.0.metastore_config.0.dataproc_metastore_service", msName_update),
1070-
10711068
),
10721069
},
10731070
},
@@ -1417,6 +1414,10 @@ resource "google_dataproc_cluster" "accelerated_cluster" {
14171414
region = "us-central1"
14181415

14191416
cluster_config {
1417+
software_config {
1418+
image_version = "2.0.35-debian10"
1419+
}
1420+
14201421
gce_cluster_config {
14211422
subnetwork = "%s"
14221423
zone = "%s"
@@ -1652,6 +1653,9 @@ resource "google_dataproc_cluster" "basic" {
16521653
region = "us-central1"
16531654

16541655
cluster_config {
1656+
software_config {
1657+
image_version = "2.0.35-debian10"
1658+
}
16551659
gce_cluster_config {
16561660
subnetwork = "%s"
16571661
zone = "us-central1-f"
@@ -1764,6 +1768,7 @@ resource "google_dataproc_cluster" "with_init_action" {
17641768

17651769
# Keep the costs down with smallest config we can get away with
17661770
software_config {
1771+
image_version = "2.0.35-debian10"
17671772
override_properties = {
17681773
"dataproc:dataproc.allow.zero.workers" = "true"
17691774
}
@@ -2028,6 +2033,7 @@ resource "google_dataproc_cluster" "with_bucket" {
20282033

20292034
# Keep the costs down with smallest config we can get away with
20302035
software_config {
2036+
image_version = "2.0.35-debian10"
20312037
override_properties = {
20322038
"dataproc:dataproc.allow.zero.workers" = "true"
20332039
}
@@ -2061,6 +2067,7 @@ resource "google_dataproc_cluster" "with_bucket" {
20612067

20622068
# Keep the costs down with smallest config we can get away with
20632069
software_config {
2070+
image_version = "2.0.35-debian10"
20642071
override_properties = {
20652072
"dataproc:dataproc.allow.zero.workers" = "true"
20662073
}
@@ -2250,6 +2257,7 @@ resource "google_dataproc_cluster" "with_service_account" {
22502257
cluster_config {
22512258
# Keep the costs down with smallest config we can get away with
22522259
software_config {
2260+
image_version = "2.0.35-debian10"
22532261
override_properties = {
22542262
"dataproc:dataproc.allow.zero.workers" = "true"
22552263
}

mmv1/third_party/terraform/services/dataproc/resource_dataproc_job_test.go.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@ resource "google_dataproc_cluster" "basic" {
862862
cluster_config {
863863
# Keep the costs down with smallest config we can get away with
864864
software_config {
865+
image_version = "2.0.35-debian10"
865866
override_properties = {
866867
"dataproc:dataproc.allow.zero.workers" = "true"
867868
}

0 commit comments

Comments
 (0)