Skip to content

Commit

Permalink
Cluster test fixes (#2611)
Browse files Browse the repository at this point in the history
* Fix container cluster tests, and signed url key, instance group

* Fix invalid accessor
  • Loading branch information
slevenick committed Nov 7, 2019
1 parent deb896b commit 476353e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ resource "google_container_cluster" "kubes" {
data "google_container_cluster" "kubes" {
name = "${google_container_cluster.kubes.name}"
location = "${google_container_cluster.kubes.zone}"
location = "${google_container_cluster.kubes.location}"
}
`, acctest.RandString(10))
}
Expand All @@ -90,7 +90,7 @@ resource "google_container_cluster" "kubes" {
data "google_container_cluster" "kubes" {
name = "${google_container_cluster.kubes.name}"
location = "${google_container_cluster.kubes.region}"
location = "${google_container_cluster.kubes.location}"
}
`, acctest.RandString(10))
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func checkComputeBackendServiceSignedUrlKeyExists(s *terraform.State) (bool, err
}

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

url, err := replaceVarsForTest(config, rs, "{{ComputeBasePath}}projects/{{project}}/global/backendServices/{{backend_service}}")
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func testAccComputeInstanceGroup_hasCorrectNetwork(nInstanceGroup string, nNetwo
return fmt.Errorf("No ID is set")
}
network, err := config.clientCompute.Networks.Get(
config.Project, rsNetwork.Primary.ID).Do()
config.Project, rsNetwork.Primary.Attributes["name"]).Do()
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func testAccCheckComputeTargetHttpProxyExists(n string) resource.TestCheckFunc {
}

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

found, err := config.clientCompute.TargetHttpProxies.Get(
config.Project, name).Do()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2449,7 +2449,7 @@ func testAccContainerCluster_withNodeConfigShieldedInstanceConfig(clusterName st
return fmt.Sprintf(`
resource "google_container_cluster" "with_node_config" {
name = "%s"
zone = "us-central1-f"
location = "us-central1-f"
initial_node_count = 1

node_config {
Expand Down Expand Up @@ -2915,7 +2915,7 @@ func testAccContainerCluster_withRecurringMaintenanceWindow(clusterName string,
return fmt.Sprintf(`
resource "google_container_cluster" "with_recurring_maintenance_window" {
name = "cluster-test-%s"
zone = "us-central1-a"
location = "us-central1-a"
initial_node_count = 1

%s
Expand Down Expand Up @@ -3354,7 +3354,7 @@ func testAccContainerCluster_withBinaryAuthorization(clusterName string, enabled
return fmt.Sprintf(`
resource "google_container_cluster" "with_binary_authorization" {
name = "%s"
locatin = "us-central1-a"
location = "us-central1-a"
initial_node_count = 1

enable_binary_authorization = %v
Expand All @@ -3366,7 +3366,7 @@ func testAccContainerCluster_withShieldedNodes(clusterName string, enabled bool)
return fmt.Sprintf(`
resource "google_container_cluster" "with_shielded_nodes" {
name = "%s"
zone = "us-central1-a"
location = "us-central1-a"
initial_node_count = 1

enable_shielded_nodes = %v
Expand Down Expand Up @@ -3401,7 +3401,7 @@ resource "google_compute_subnetwork" "container_subnetwork" {

resource "google_container_cluster" "with_flexible_cidr" {
name = "%s"
locatin = "us-central1-a"
location = "us-central1-a"
initial_node_count = 3

network = "${google_compute_network.container_network.name}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,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"
region = "us-central1"
private_ip_google_access = true

secondary_ip_range {
Expand Down

0 comments on commit 476353e

Please sign in to comment.