Skip to content

Commit 6467fec

Browse files
committed
add stub-domains and stub-domains-private
1 parent 590c97d commit 6467fec

File tree

15 files changed

+637
-269
lines changed

15 files changed

+637
-269
lines changed

.kitchen.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,6 @@ suites:
4646
systems:
4747
- name: simple_regional_with_ipv6
4848
backend: local
49-
- name: "stub_domains"
50-
transport:
51-
root_module_directory: test/fixtures/stub_domains
52-
verifier:
53-
systems:
54-
- name: stub_domains
55-
backend: local
56-
controls:
57-
- gcloud
58-
- kubectl
59-
# Disabled due to issue #264
60-
# (https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/264)
61-
# - name: stub_domains_private
62-
# transport:
63-
# root_module_directory: test/fixtures/stub_domains_private
64-
# systems:
65-
# - name: stub_domains_private
66-
# backend: local
6749
- name: "stub_domains_upstream_nameservers"
6850
transport:
6951
root_module_directory: test/fixtures/stub_domains_upstream_nameservers

build/int.cloudbuild.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,21 @@ steps:
200200
- verify simple-zonal-private-local
201201
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
202202
args: ['/bin/bash', '-c', 'cft test run TestSimpleZonalPrivate --stage teardown --verbose']
203-
- id: converge stub-domains-local
203+
- id: apply stub-domains-local
204204
waitFor:
205205
- create-all
206206
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
207-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge stub-domains-local']
207+
args: ['/bin/bash', '-c', 'cft test run TestStubDomains --stage apply --verbose --test-dir test/integration']
208208
- id: verify stub-domains-local
209209
waitFor:
210-
- converge stub-domains-local
210+
- apply stub-domains-local
211211
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
212-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify stub-domains-local']
212+
args: ['/bin/bash', '-c', 'cft test run TestStubDomains --stage apply --verify --test-dir test/integration']
213213
- id: destroy stub-domains-local
214214
waitFor:
215215
- verify stub-domains-local
216216
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
217-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy stub-domains-local']
217+
args: ['/bin/bash', '-c', 'cft test run TestStubDomains --stage destroy --verbose --test-dir test/integration']
218218
- id: apply upstream-nameservers-local
219219
waitFor:
220220
- create-all

test/fixtures/stub_domains/example.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2018-2025 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,6 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17+
locals {
18+
compute_engine_service_account = var.compute_engine_service_accounts[1]
19+
}
20+
1721
module "example" {
1822
source = "../../../examples/stub_domains"
1923

@@ -24,6 +28,6 @@ module "example" {
2428
subnetwork = google_compute_subnetwork.main.name
2529
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2630
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
27-
compute_engine_service_account = var.compute_engine_service_accounts[1]
31+
compute_engine_service_account = local.compute_engine_service_account
2832
}
2933

test/fixtures/stub_domains/outputs.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2018-2025 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,3 +56,11 @@ output "service_account" {
5656
description = "The service account to default running nodes as if not overridden in `node_pools`."
5757
value = module.example.service_account
5858
}
59+
60+
output "random_string" {
61+
value = random_string.suffix.result
62+
}
63+
64+
output "compute_engine_service_account" {
65+
value = local.compute_engine_service_account
66+
}

test/fixtures/stub_domains_private/main.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2018-2025 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,6 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17+
locals {
18+
compute_engine_service_account = var.compute_engine_service_accounts[1]
19+
}
20+
1721
resource "random_string" "suffix" {
1822
length = 4
1923
special = false
@@ -49,7 +53,7 @@ resource "google_compute_subnetwork" "main" {
4953
module "example" {
5054
source = "../../../examples/stub_domains_private"
5155

52-
compute_engine_service_account = var.compute_engine_service_accounts[1]
56+
compute_engine_service_account = local.compute_engine_service_account
5357
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
5458
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
5559
network = google_compute_network.main.name

test/fixtures/stub_domains_private/outputs.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2018-2025 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,3 +56,11 @@ output "service_account" {
5656
description = "The service account to default running nodes as if not overridden in `node_pools`."
5757
value = module.example.service_account
5858
}
59+
60+
output "random_string" {
61+
value = random_string.suffix.result
62+
}
63+
64+
output "compute_engine_service_account" {
65+
value = local.compute_engine_service_account
66+
}

test/integration/node_pool/testdata/TestNodePool.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@
249249
"name": "default-pool",
250250
"networkConfig": {
251251
"podIpv4CidrBlock": "192.168.0.0/18",
252-
"podIpv4RangeUtilization": 0.0624,
253252
"podRange": "cft-gke-test-pods-RANDOM_STRING"
254253
},
255254
"podIpv4CidrSize": 24,
@@ -302,7 +301,6 @@
302301
"name": "nap-e2-medium-1d469r1p",
303302
"networkConfig": {
304303
"podIpv4CidrBlock": "192.168.0.0/18",
305-
"podIpv4RangeUtilization": 0.0624,
306304
"podRange": "cft-gke-test-pods-RANDOM_STRING"
307305
},
308306
"placementPolicy": {},
@@ -395,7 +393,6 @@
395393
"name": "pool-01",
396394
"networkConfig": {
397395
"podIpv4CidrBlock": "192.168.0.0/18",
398-
"podIpv4RangeUtilization": 0.0624,
399396
"podRange": "cft-gke-test-pods-RANDOM_STRING"
400397
},
401398
"podIpv4CidrSize": 24,
@@ -490,7 +487,6 @@
490487
"name": "pool-02",
491488
"networkConfig": {
492489
"podIpv4CidrBlock": "192.168.0.0/18",
493-
"podIpv4RangeUtilization": 0.0624,
494490
"podRange": "cft-gke-test-pods-RANDOM_STRING"
495491
},
496492
"podIpv4CidrSize": 24,
@@ -583,7 +579,6 @@
583579
"networkConfig": {
584580
"enablePrivateNodes": false,
585581
"podIpv4CidrBlock": "172.16.0.0/18",
586-
"podIpv4RangeUtilization": 0.0625,
587582
"podRange": "test"
588583
},
589584
"podIpv4CidrSize": 24,
@@ -671,7 +666,6 @@
671666
"name": "pool-04",
672667
"networkConfig": {
673668
"podIpv4CidrBlock": "192.168.0.0/18",
674-
"podIpv4RangeUtilization": 0.0624,
675669
"podRange": "cft-gke-test-pods-RANDOM_STRING"
676670
},
677671
"podIpv4CidrSize": 24,
@@ -759,7 +753,6 @@
759753
"name": "pool-05",
760754
"networkConfig": {
761755
"podIpv4CidrBlock": "192.168.0.0/18",
762-
"podIpv4RangeUtilization": 0.0624,
763756
"podRange": "cft-gke-test-pods-RANDOM_STRING"
764757
},
765758
"podIpv4CidrSize": 24,

test/integration/stub_domains/controls/gcloud.rb

Lines changed: 0 additions & 52 deletions
This file was deleted.

test/integration/stub_domains/controls/kubectl.rb

Lines changed: 0 additions & 88 deletions
This file was deleted.

test/integration/stub_domains/inspec.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)