Skip to content

Commit c000ef0

Browse files
committed
add tests
Signed-off-by: drfaust92 <[email protected]>
1 parent a82e717 commit c000ef0

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

examples/node_pool/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ module "gke" {
6161
logging_variant = "MAX_THROUGHPUT"
6262
dns_allow_external_traffic = true
6363

64+
additional_ip_ranges_config = [
65+
{
66+
subnetwork = var.subnetwork
67+
pod_ipv4_range_names = [var.additional_ip_pod_range]
68+
}
69+
]
70+
6471
resource_manager_tags = {
6572
"${var.project_id}/${google_tags_tag_key.key.short_name}" = google_tags_tag_value.value.short_name
6673
}

examples/node_pool/test_outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ output "ip_range_services" {
5252
value = var.ip_range_services
5353
}
5454

55+
output "additional_ip_range_pods" {
56+
description = "The secondary IP range used for pods in the additional range"
57+
value = var.additional_ip_pod_range
58+
}
59+
5560
output "zones" {
5661
description = "List of zones in which the cluster resides"
5762
value = module.gke.zones

examples/node_pool/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ variable "ip_range_services" {
4848
description = "The secondary ip range to use for services"
4949
}
5050

51+
variable "additional_ip_pod_range" {
52+
description = "The secondary ip range to use for pods in the additional range"
53+
}
54+
5155
variable "compute_engine_service_account" {
5256
description = "Service account to associate to the nodes in the cluster"
5357
}

test/fixtures/node_pool/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ output "ip_range_services" {
4949
value = google_compute_subnetwork.main.secondary_ip_range[1].range_name
5050
}
5151

52+
output "additional_ip_range_pods" {
53+
description = "The secondary IP range used for pods in the additional range"
54+
value = google_compute_subnetwork.main.secondary_ip_range[2].range_name
55+
}
56+
5257
output "zones" {
5358
description = "List of zones in which the cluster resides"
5459
value = module.example.zones

test/integration/node_pool/testdata/TestNodePool.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@
9090
"servicesIpv4CidrBlock": "192.168.64.0/18",
9191
"servicesSecondaryRangeName": "cft-gke-test-services-RANDOM_STRING",
9292
"stackType": "IPV4",
93-
"useIpAliases": true
93+
"useIpAliases": true,
94+
"additionalIpRangesConfigs": [
95+
{
96+
"subnetwork": "projects/PROJECT_ID/regions/europe-west4/subnetworks/cft-gke-test-RANDOM_STRING",
97+
"podIpv4RangeNames": ["test"]
98+
}
99+
]
94100
},
95101
"labelFingerprint": "78cdf2f6",
96102
"legacyAbac": {},

0 commit comments

Comments
 (0)