Skip to content

Commit b06c425

Browse files
committed
update int test to split between two projects
1 parent 932bd0e commit b06c425

File tree

44 files changed

+129
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+129
-77
lines changed

examples/safer_cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This example illustrates how to instantiate the opinionated Safer Cluster module
2222
| location | |
2323
| master\_kubernetes\_version | Kubernetes version of the master |
2424
| network\_name | The name of the VPC being created |
25+
| project\_id | The project ID the cluster is in |
2526
| region | The region in which the cluster resides |
2627
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
2728
| subnet\_names | The names of the subnet being created |

examples/safer_cluster/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,8 @@ output "zones" {
6969
description = "List of zones in which the cluster resides"
7070
value = module.gke.zones
7171
}
72+
73+
output "project_id" {
74+
description = "The project ID the cluster is in"
75+
value = var.project_id
76+
}

test/fixtures/deploy_service/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
module "example" {
1818
source = "../../../examples/deploy_service"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[0]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
network = google_compute_network.main.name
2424
subnetwork = google_compute_subnetwork.main.name
2525
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2626
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
27-
compute_engine_service_account = var.compute_engine_service_account
27+
compute_engine_service_account = var.compute_engine_service_accounts[0]
2828
}
2929

test/fixtures/deploy_service/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "random_string" "suffix" {
2121
}
2222

2323
provider "google" {
24-
project = var.project_id
24+
project = var.project_ids[0]
2525
}
2626

2727
resource "google_compute_network" "main" {

test/fixtures/disable_client_cert/example.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
module "example" {
1818
source = "../../../examples/disable_client_cert"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[0]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
network = google_compute_network.main.name
24-
network_project_id = var.project_id
24+
network_project_id = var.project_ids[0]
2525
subnetwork = google_compute_subnetwork.main.name
2626
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2727
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
28-
compute_engine_service_account = var.compute_engine_service_account
28+
compute_engine_service_account = var.compute_engine_service_accounts[0]
2929
}
3030

test/fixtures/disable_client_cert/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "random_string" "suffix" {
2121
}
2222

2323
provider "google" {
24-
project = var.project_id
24+
project = var.project_ids[0]
2525
}
2626

2727
resource "google_compute_network" "main" {

test/fixtures/node_pool/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
module "example" {
1818
source = "../../../examples/node_pool"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[0]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
zones = slice(var.zones, 0, 1)
2424
network = google_compute_network.main.name
2525
subnetwork = google_compute_subnetwork.main.name
2626
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2727
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
28-
compute_engine_service_account = var.compute_engine_service_account
28+
compute_engine_service_account = var.compute_engine_service_accounts[0]
2929
}
3030

test/fixtures/node_pool/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "random_string" "suffix" {
2121
}
2222

2323
provider "google" {
24-
project = var.project_id
24+
project = var.project_ids[0]
2525
}
2626

2727
resource "google_compute_network" "main" {

test/fixtures/node_pool_update_variant/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
module "example" {
1818
source = "../../../examples/node_pool_update_variant"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[0]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
zones = slice(var.zones, 0, 1)
2424
network = google_compute_network.main.name
2525
subnetwork = google_compute_subnetwork.main.name
2626
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2727
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
28-
compute_engine_service_account = var.compute_engine_service_account
28+
compute_engine_service_account = var.compute_engine_service_accounts[0]
2929
}

test/fixtures/node_pool_update_variant/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "random_string" "suffix" {
2121
}
2222

2323
provider "google" {
24-
project = var.project_id
24+
project = var.project_ids[0]
2525
}
2626

2727
resource "google_compute_network" "main" {

test/fixtures/private_zonal_with_networking/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
module "example" {
1818
source = "../../../examples/private_zonal_with_networking"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[0]
2121
region = var.region
2222
zones = var.zones
2323
}

test/fixtures/private_zonal_with_networking/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
output "project_id" {
19-
value = var.project_id
19+
value = module.example.project_id
2020
}
2121

2222
output "location" {

test/fixtures/private_zonal_with_networking/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "project_id" {
17+
variable "project_ids" {
18+
type = list(string)
1819
description = "The project ID to host the cluster in"
1920
}
2021

test/fixtures/safer_cluster/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
module "example" {
1818
source = "../../../examples/safer_cluster"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[0]
2121
region = var.region
22-
compute_engine_service_account = var.compute_engine_service_account
22+
compute_engine_service_account = var.compute_engine_service_accounts[0]
2323
}

test/fixtures/safer_cluster/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
output "project_id" {
18-
value = var.project_id
18+
value = module.example.project_id
1919
}
2020

2121
output "region" {

test/fixtures/sandbox_enabled/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
module "example" {
1818
source = "../../../examples/simple_regional_beta"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[0]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
network = google_compute_network.main.name
2424
subnetwork = google_compute_subnetwork.main.name
2525
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2626
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
27-
compute_engine_service_account = var.compute_engine_service_account
27+
compute_engine_service_account = var.compute_engine_service_accounts[0]
2828
istio = false
2929
cloudrun = false
3030
node_metadata = "UNSPECIFIED"

test/fixtures/sandbox_enabled/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "random_string" "suffix" {
2121
}
2222

2323
provider "google" {
24-
project = var.project_id
24+
project = var.project_ids[0]
2525
}
2626

2727
resource "google_compute_network" "main" {

test/fixtures/shared/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
output "project_id" {
18-
value = var.project_id
18+
value = module.example.project_id
1919
}
2020

2121
output "region" {

test/fixtures/shared/variables.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "project_id" {
18-
description = "The GCP project to use for integration tests"
17+
variable "project_ids" {
18+
type = list(string)
19+
description = "The GCP projects to use for integration tests"
1920
}
2021

2122
variable "region" {
@@ -29,8 +30,9 @@ variable "zones" {
2930
default = ["us-central1-a", "us-central1-b", "us-central1-c"]
3031
}
3132

32-
variable "compute_engine_service_account" {
33-
description = "The email address of the service account to associate with the GKE cluster"
33+
variable "compute_engine_service_accounts" {
34+
type = list(string)
35+
description = "The email addresses of the service account to associate with the GKE cluster"
3436
}
3537

3638
variable "registry_project_id" {

test/fixtures/shared_vpc/example.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
module "example" {
1818
source = "../../../examples/shared_vpc"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[0]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
network = google_compute_network.main.name
24-
network_project_id = var.project_id
24+
network_project_id = var.project_ids[0]
2525
subnetwork = google_compute_subnetwork.main.name
2626
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2727
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
28-
compute_engine_service_account = var.compute_engine_service_account
28+
compute_engine_service_account = var.compute_engine_service_accounts[0]
2929
}
3030

test/fixtures/shared_vpc/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "random_string" "suffix" {
2121
}
2222

2323
provider "google" {
24-
project = var.project_id
24+
project = var.project_ids[0]
2525
}
2626

2727
resource "google_compute_network" "main" {

test/fixtures/simple_regional/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
module "example" {
1818
source = "../../../examples/simple_regional"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[0]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
network = google_compute_network.main.name
2424
subnetwork = google_compute_subnetwork.main.name
2525
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2626
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
27-
compute_engine_service_account = var.compute_engine_service_account
27+
compute_engine_service_account = var.compute_engine_service_accounts[0]
2828
skip_provisioners = true
2929
}

test/fixtures/simple_regional/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "random_string" "suffix" {
2121
}
2222

2323
provider "google" {
24-
project = var.project_id
24+
project = var.project_ids[0]
2525
}
2626

2727
resource "google_compute_network" "main" {

test/fixtures/simple_regional_private/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
module "example" {
1818
source = "../../../examples/simple_regional_private"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[1]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
network = google_compute_network.main.name
2424
subnetwork = google_compute_subnetwork.main.name
2525
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2626
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
27-
compute_engine_service_account = var.compute_engine_service_account
27+
compute_engine_service_account = var.compute_engine_service_accounts[1]
2828
}
2929

test/fixtures/simple_regional_private/network.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ resource "random_string" "suffix" {
2121
}
2222

2323
resource "google_compute_network" "main" {
24-
project = var.project_id
24+
project = var.project_ids[1]
2525
name = "cft-gke-test-${random_string.suffix.result}"
2626
auto_create_subnetworks = false
2727
}
2828

2929
resource "google_compute_subnetwork" "main" {
30-
project = var.project_id
30+
project = var.project_ids[1]
3131
name = "cft-gke-test-${random_string.suffix.result}"
3232
ip_cidr_range = "10.0.0.0/17"
3333
region = var.region

test/fixtures/simple_regional_with_networking/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
module "example" {
1818
source = "../../../examples/simple_regional_with_networking"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[1]
2121
region = var.region
2222
}

test/fixtures/simple_regional_with_networking/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
output "project_id" {
19-
value = var.project_id
19+
value = module.example.project_id
2020
}
2121

2222
output "location" {

test/fixtures/simple_regional_with_networking/variables.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "project_id" {
18-
description = "The project ID to host the cluster in"
17+
variable "project_ids" {
18+
type = list(string)
19+
description = "The GCP projects to use for integration tests"
1920
}
2021

2122
variable "region" {

test/fixtures/simple_zonal/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
module "example" {
1818
source = "../../../examples/simple_zonal_with_acm"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[1]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
zones = slice(var.zones, 0, 1)

test/fixtures/simple_zonal/network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "random_string" "suffix" {
2121
}
2222

2323
provider "google" {
24-
project = var.project_id
24+
project = var.project_ids[1]
2525
}
2626

2727
resource "google_compute_network" "main" {

test/fixtures/simple_zonal_private/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
module "example" {
1818
source = "../../../examples/simple_zonal_private"
1919

20-
project_id = var.project_id
20+
project_id = var.project_ids[1]
2121
cluster_name_suffix = "-${random_string.suffix.result}"
2222
region = var.region
2323
zones = slice(var.zones, 0, 1)
2424
network = google_compute_network.main.name
2525
subnetwork = google_compute_subnetwork.main.name
2626
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2727
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
28-
compute_engine_service_account = var.compute_engine_service_account
28+
compute_engine_service_account = var.compute_engine_service_accounts[1]
2929
}
3030

test/fixtures/simple_zonal_private/network.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ resource "random_string" "suffix" {
2222

2323

2424
resource "google_compute_network" "main" {
25-
project = var.project_id
25+
project = var.project_ids[1]
2626
name = "cft-gke-test-${random_string.suffix.result}"
2727
auto_create_subnetworks = false
2828
}
2929

3030
resource "google_compute_subnetwork" "main" {
31-
project = var.project_id
31+
project = var.project_ids[1]
3232
name = "cft-gke-test-${random_string.suffix.result}"
3333
ip_cidr_range = "10.0.0.0/17"
3434
region = var.region

0 commit comments

Comments
 (0)