Skip to content

Commit 566db85

Browse files
Merge branch 'master' into confidential-nodes-example
2 parents dceb039 + f0e0b41 commit 566db85

File tree

20 files changed

+1023
-741
lines changed

20 files changed

+1023
-741
lines changed

.kitchen.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,3 @@ suites:
8585
systems:
8686
- name: workload_metadata_config
8787
backend: local
88-
- name: "node_pool"
89-
transport:
90-
root_module_directory: test/fixtures/node_pool
91-
verifier:
92-
systems:
93-
- name: node_pool
94-
backend: local
95-
controls:
96-
- gcloud
97-
- kubectl

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NOTE: This file is automatically generated from values at:
22
# https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/blob/master/infra/terraform/test-org/org/locals.tf
33

4-
* @terraform-google-modules/cft-admins @ericyz @gtsorbo
4+
* @terraform-google-modules/cft-admins @apeabody @ericyz @gtsorbo
55

66
# NOTE: GitHub CODEOWNERS locations:
77
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-and-branch-protection

build/int.cloudbuild.yaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,21 +305,21 @@ steps:
305305
- verify deploy-service-local
306306
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
307307
args: ['/bin/bash', '-c', 'cft test run TestDeployService --stage destroy --verbose']
308-
- id: converge node-pool-local
308+
- id: apply node-pool-local
309309
waitFor:
310310
- create-all
311311
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
312-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge node-pool-local']
312+
args: ['/bin/bash', '-c', 'cft test run TestNodePool --stage apply --verbose']
313313
- id: verify node-pool-local
314314
waitFor:
315-
- converge node-pool-local
315+
- apply node-pool-local
316316
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
317-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify node-pool-local']
317+
args: ['/bin/bash', '-c', 'cft test run TestNodePool --stage verify --verbose']
318318
- id: destroy node-pool-local
319319
waitFor:
320320
- verify node-pool-local
321321
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
322-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy node-pool-local']
322+
args: ['/bin/bash', '-c', 'cft test run TestNodePool --stage destroy --verbose']
323323
- id: apply sandbox-enabled-local
324324
waitFor:
325325
- create-all
@@ -471,6 +471,21 @@ steps:
471471
- verify simple-fleet-app-operator-permissions
472472
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
473473
args: ['/bin/bash', '-c', 'cft test run TestSimpleFleetAppOperatorPermissions --stage teardown --verbose']
474+
- id: apply test-confidential-safer-cluster
475+
waitFor:
476+
- create-all
477+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
478+
args: ['/bin/bash', '-c', 'cft test run TestConfidentialSaferCluster --stage apply --verbose']
479+
- id: verify test-confidential-safer-cluster
480+
waitFor:
481+
- apply test-confidential-safer-cluster
482+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
483+
args: ['/bin/bash', '-c', 'cft test run TestConfidentialSaferCluster --stage verify --verbose']
484+
- id: teardown test-confidential-safer-cluster
485+
waitFor:
486+
- verify test-confidential-safer-cluster
487+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
488+
args: ['/bin/bash', '-c', 'cft test run TestConfidentialSaferCluster --stage teardown --verbose']
474489
tags:
475490
- 'ci'
476491
- 'integration'

examples/confidential_safer_cluster/network.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616

1717
module "gcp-network" {
1818
source = "terraform-google-modules/network/google"
19-
version = ">= 7.5"
19+
version = "~> 10.0"
2020

2121
project_id = var.project_id
2222
network_name = local.network_name
23+
routing_mode = "GLOBAL"
2324

2425
subnets = [
2526
{

examples/confidential_safer_cluster/versions.tf

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

1717
terraform {
18-
required_version = ">= 0.13"
18+
required_version = ">= 1.3"
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"

examples/node_pool/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module "gke" {
4343
disable_legacy_metadata_endpoints = false
4444
cluster_autoscaling = var.cluster_autoscaling
4545
deletion_protection = false
46+
service_account = "default"
4647

4748
node_pools = [
4849
{

test/fixtures/node_pool/example.tf

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

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

@@ -25,7 +29,7 @@ module "example" {
2529
subnetwork = google_compute_subnetwork.main.name
2630
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name
2731
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name
28-
compute_engine_service_account = var.compute_engine_service_accounts[0]
32+
compute_engine_service_account = local.compute_engine_service_account
2933

3034
cluster_autoscaling = {
3135
enabled = true

test/fixtures/node_pool/outputs.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,11 @@ output "service_account" {
8383
output "registry_project_ids" {
8484
value = var.registry_project_ids
8585
}
86+
87+
output "random_string" {
88+
value = random_string.suffix.result
89+
}
90+
91+
output "compute_engine_service_account" {
92+
value = local.compute_engine_service_account
93+
}

test/integration/confidential_safer_cluster/confidential_safer_cluster_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func TestConfidentialSaferCluster(t *testing.T) {
3232
bpt.DefineVerify(func(assert *assert.Assertions) {
3333
// Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token
3434
// bpt.DefaultVerify(assert)
35+
testutils.TGKEVerify(t, bpt, assert)
3536

3637
projectId := bpt.GetStringOutput("project_id")
3738
location := bpt.GetStringOutput("location")

test/integration/go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ require (
99
github.com/gruntwork-io/terratest v0.48.1
1010
github.com/hashicorp/terraform-json v0.24.0
1111
github.com/stretchr/testify v1.10.0
12+
github.com/tidwall/gjson v1.18.0
13+
golang.org/x/sync v0.10.0
1214
)
1315

1416
require (
@@ -103,7 +105,6 @@ require (
103105
github.com/pquerna/otp v1.4.0 // indirect
104106
github.com/russross/blackfriday/v2 v2.1.0 // indirect
105107
github.com/spf13/pflag v1.0.5 // indirect
106-
github.com/tidwall/gjson v1.18.0 // indirect
107108
github.com/tidwall/match v1.1.1 // indirect
108109
github.com/tidwall/pretty v1.2.1 // indirect
109110
github.com/tidwall/sjson v1.2.5 // indirect
@@ -112,14 +113,13 @@ require (
112113
github.com/urfave/cli/v2 v2.25.7 // indirect
113114
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
114115
github.com/zclconf/go-cty v1.15.1 // indirect
115-
golang.org/x/crypto v0.29.0 // indirect
116+
golang.org/x/crypto v0.31.0 // indirect
116117
golang.org/x/mod v0.22.0 // indirect
117118
golang.org/x/net v0.31.0 // indirect
118119
golang.org/x/oauth2 v0.24.0 // indirect
119-
golang.org/x/sync v0.10.0 // indirect
120-
golang.org/x/sys v0.27.0 // indirect
121-
golang.org/x/term v0.26.0 // indirect
122-
golang.org/x/text v0.20.0 // indirect
120+
golang.org/x/sys v0.28.0 // indirect
121+
golang.org/x/term v0.27.0 // indirect
122+
golang.org/x/text v0.21.0 // indirect
123123
golang.org/x/time v0.8.0 // indirect
124124
golang.org/x/tools v0.22.0 // indirect
125125
google.golang.org/protobuf v1.35.1 // indirect

0 commit comments

Comments
 (0)