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

Test updates to not depend on id format. Also test fixes #2609

Merged
merged 3 commits into from
Nov 7, 2019
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 @@ -45,14 +45,16 @@ func testAccCheckComputeSslCertificateExists(n string) resource.TestCheckFunc {
}

config := testAccProvider.Meta().(*Config)
// We don't specify a name, but it is saved during create
name := rs.Primary.Attributes["name"]

found, err := config.clientCompute.SslCertificates.Get(
config.Project, rs.Primary.ID).Do()
config.Project, name).Do()
if err != nil {
return err
}

if found.Name != rs.Primary.ID {
if found.Name != name {
return fmt.Errorf("Certificate not found")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func testAccCheckComputeSslPolicyExists(n string, sslPolicy *compute.SslPolicy)
return fmt.Errorf("Error Reading SSL Policy %s: %s", name, err)
}

if found.Name != rs.Primary.ID {
if found.Name != name {
return fmt.Errorf("SSL Policy not found")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ func testAccCheckComputeTargetHttpProxyExists(n string) resource.TestCheckFunc {
}

config := testAccProvider.Meta().(*Config)
name := rs.Attributes["name"]

found, err := config.clientCompute.TargetHttpProxies.Get(
config.Project, rs.Primary.ID).Do()
config.Project, name).Do()
if err != nil {
return err
}

if found.Name != rs.Primary.ID {
if found.Name != name {
return fmt.Errorf("TargetHttpProxy not found")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ func testAccCheckComputeTargetHttpsProxyExists(n string, proxy *compute.TargetHt
}

config := testAccProvider.Meta().(*Config)
name := rs.Primary.Attributes["name"]

found, err := config.clientCompute.TargetHttpsProxies.Get(
config.Project, rs.Primary.ID).Do()
config.Project, name).Do()
if err != nil {
return err
}

if found.Name != rs.Primary.ID {
if found.Name != name {
return fmt.Errorf("TargetHttpsProxy not found")
}

Expand Down
5 changes: 3 additions & 2 deletions third_party/terraform/tests/resource_compute_url_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@ func testAccCheckComputeUrlMapExists(n string) resource.TestCheckFunc {
}

config := testAccProvider.Meta().(*Config)
name := rs.Primary.Attributes["name"]

found, err := config.clientCompute.UrlMaps.Get(
config.Project, rs.Primary.ID).Do()
config.Project, name).Do()
if err != nil {
return err
}

if found.Name != rs.Primary.ID {
if found.Name != name {
return fmt.Errorf("Url map not found")
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ resource "google_compute_subnetwork" "container_subnetwork" {
name = "${google_compute_network.container_network.name}"
network = "${google_compute_network.container_network.name}"
ip_cidr_range = "10.0.36.0/24"
location = "us-central1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind setting this back to region? It was probably a find/replace gone a little too far.

region = "us-central1"
private_ip_google_access = true

secondary_ip_range {
Expand Down