From 0da0832cd34c36dc712e4bb4a01a5e21686ae5dc Mon Sep 17 00:00:00 2001 From: Riley Karson Date: Mon, 27 Aug 2018 12:20:32 -0700 Subject: [PATCH] Fix Terraform autoscaler tests disk image (#416) Merged PR #416. --- build/terraform | 2 +- .../tests/resource_compute_autoscaler_test.go | 7 ++++++- .../resource_compute_region_autoscaler_test.go | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/build/terraform b/build/terraform index e4a386848c0f..7e82a982e403 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit e4a386848c0fceb3ab3322600f56e4a119f09dbc +Subproject commit 7e82a982e403b0cb0fa82c232ed5cf90af60b933 diff --git a/templates/terraform/tests/resource_compute_autoscaler_test.go b/templates/terraform/tests/resource_compute_autoscaler_test.go index 8f3e49ebb9b2..f68abb49ff7b 100644 --- a/templates/terraform/tests/resource_compute_autoscaler_test.go +++ b/templates/terraform/tests/resource_compute_autoscaler_test.go @@ -221,6 +221,11 @@ func testAccCheckComputeAutoscalerUpdated(n string, max int64) resource.TestChec func testAccComputeAutoscaler_scaffolding(it_name, tp_name, igm_name string) string { return fmt.Sprintf(` +data "google_compute_image" "my_image" { + family = "debian-9" + project = "debian-cloud" +} + resource "google_compute_instance_template" "foobar" { name = "%s" machine_type = "n1-standard-1" @@ -228,7 +233,7 @@ resource "google_compute_instance_template" "foobar" { tags = ["foo", "bar"] disk { - source_image = "debian-cloud/debian-8-jessie-v20160803" + source_image = "${data.google_compute_image.my_image.self_link}" auto_delete = true boot = true } diff --git a/templates/terraform/tests/resource_compute_region_autoscaler_test.go b/templates/terraform/tests/resource_compute_region_autoscaler_test.go index 4a5ee3c87efd..2336fddc27d1 100644 --- a/templates/terraform/tests/resource_compute_region_autoscaler_test.go +++ b/templates/terraform/tests/resource_compute_region_autoscaler_test.go @@ -152,6 +152,11 @@ func testAccCheckComputeRegionAutoscalerUpdated(n string, max int64) resource.Te func testAccComputeRegionAutoscaler_basic(it_name, tp_name, igm_name, autoscaler_name string) string { return fmt.Sprintf(` +data "google_compute_image" "my_image" { + family = "debian-9" + project = "debian-cloud" +} + resource "google_compute_instance_template" "foobar" { name = "%s" machine_type = "n1-standard-1" @@ -159,7 +164,7 @@ resource "google_compute_instance_template" "foobar" { tags = ["foo", "bar"] disk { - source_image = "debian-cloud/debian-8-jessie-v20160803" + source_image = "${data.google_compute_image.my_image.self_link}" auto_delete = true boot = true } @@ -212,6 +217,11 @@ resource "google_compute_region_autoscaler" "foobar" { func testAccComputeRegionAutoscaler_update(it_name, tp_name, igm_name, autoscaler_name string) string { return fmt.Sprintf(` +data "google_compute_image" "my_image" { + family = "debian-9" + project = "debian-cloud" +} + resource "google_compute_instance_template" "foobar" { name = "%s" machine_type = "n1-standard-1" @@ -219,7 +229,7 @@ resource "google_compute_instance_template" "foobar" { tags = ["foo", "bar"] disk { - source_image = "debian-cloud/debian-8-jessie-v20160803" + source_image = "${data.google_compute_image.my_image.self_link}" auto_delete = true boot = true }