Skip to content

Commit a146099

Browse files
committed
switch to glcoud
1 parent 8b7ddd4 commit a146099

File tree

7 files changed

+80
-202
lines changed

7 files changed

+80
-202
lines changed

build/int.cloudbuild.yaml

Lines changed: 2 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -29,172 +29,21 @@ steps:
2929
- prepare
3030
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
3131
args: ['/bin/bash', '-c', 'cft test run TestNodePool --stage init --verbose']
32-
- id: converge node-pool-local
32+
- id: apply node-pool-local
3333
waitFor:
3434
- init node-pool-local
3535
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
3636
args: ['/bin/bash', '-c', 'cft test run TestNodePool --stage apply --verbose']
3737
- id: verify node-pool-local
3838
waitFor:
39-
- converge node-pool-local
39+
- apply node-pool-local
4040
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
4141
args: ['/bin/bash', '-c', 'cft test run TestNodePool --stage verify --verbose']
4242
- id: destroy node-pool-local
4343
waitFor:
4444
- verify node-pool-local
4545
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
4646
args: ['/bin/bash', '-c', 'cft test run TestNodePool --stage destroy --verbose']
47-
- id: apply sandbox-enabled-local
48-
waitFor:
49-
- create-all
50-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
51-
args: ['/bin/bash', '-c', 'cft test run TestSandboxEnabled --stage apply --verbose']
52-
- id: verify sandbox-enabled-local
53-
waitFor:
54-
- apply sandbox-enabled-local
55-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
56-
args: ['/bin/bash', '-c', 'cft test run TestSandboxEnabled --stage verify --verbose']
57-
- id: destroy sandbox-enabled-local
58-
waitFor:
59-
- verify sandbox-enabled-local
60-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
61-
args: ['/bin/bash', '-c', 'cft test run TestSandboxEnabled --stage destroy --verbose']
62-
- id: apply workload-identity-local
63-
waitFor:
64-
- create-all
65-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
66-
args: ['/bin/bash', '-c', 'cft test run TestWorkloadIdentity --stage apply --verbose']
67-
- id: verify workload-identity-local
68-
waitFor:
69-
- apply workload-identity-local
70-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
71-
args: ['/bin/bash', '-c', 'cft test run TestWorkloadIdentity --stage verify --verbose']
72-
- id: destroy workload-identity-local
73-
waitFor:
74-
- verify workload-identity-local
75-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
76-
args: ['/bin/bash', '-c', 'cft test run TestWorkloadIdentity --stage teardown --verbose']
77-
- id: apply safer-cluster-iap-bastion-local
78-
waitFor:
79-
- create-all
80-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
81-
args: ['/bin/bash', '-c', 'cft test run TestSaferClusterIapBastion --stage apply --verbose']
82-
- id: verify safer-cluster-iap-bastion-local
83-
waitFor:
84-
- apply safer-cluster-iap-bastion-local
85-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
86-
args: ['/bin/bash', '-c', 'cft test run TestSaferClusterIapBastion --stage verify --verbose']
87-
- id: destroy safer-cluster-iap-bastion-local
88-
waitFor:
89-
- verify safer-cluster-iap-bastion-local
90-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
91-
args: ['/bin/bash', '-c', 'cft test run TestSaferClusterIapBastion --stage teardown --verbose']
92-
- id: apply simple-zonal-with-asm-local
93-
waitFor:
94-
- create-all
95-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
96-
args: ['/bin/bash', '-c', 'cft test run TestSimpleZonalWithASM --stage apply --verbose']
97-
- id: verify simple-zonal-with-asm-local
98-
waitFor:
99-
- apply simple-zonal-with-asm-local
100-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
101-
args: ['/bin/bash', '-c', 'cft test run TestSimpleZonalWithASM --stage verify --verbose']
102-
- id: destroy simple-zonal-with-asm-local
103-
waitFor:
104-
- verify simple-zonal-with-asm-local
105-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
106-
args: ['/bin/bash', '-c', 'cft test run TestSimpleZonalWithASM --stage teardown --verbose']
107-
- id: apply simple-autopilot-private-local
108-
waitFor:
109-
- create-all
110-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
111-
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPrivate --stage apply --verbose']
112-
- id: verify simple-autopilot-private-local
113-
waitFor:
114-
- apply simple-autopilot-private-local
115-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
116-
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPrivate --stage verify --verbose']
117-
- id: destroy simple-autopilot-private-local
118-
waitFor:
119-
- verify simple-autopilot-private-local
120-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
121-
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPrivate --stage teardown --verbose']
122-
- id: apply autopilot-private-firewalls
123-
waitFor:
124-
- create-all
125-
- destroy simple-autopilot-private-local
126-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
127-
args: ['/bin/bash', '-c', 'cft test run TestAutopilotPrivateFirewalls --stage apply --verbose']
128-
- id: verify autopilot-private-firewalls
129-
waitFor:
130-
- apply autopilot-private-firewalls
131-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
132-
args: ['/bin/bash', '-c', 'cft test run TestAutopilotPrivateFirewalls --stage verify --verbose']
133-
- id: destroy autopilot-private-firewalls
134-
waitFor:
135-
- verify autopilot-private-firewalls
136-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
137-
args: ['/bin/bash', '-c', 'cft test run TestAutopilotPrivateFirewalls --stage destroy --verbose']
138-
- id: apply simple-autopilot-public-local
139-
waitFor:
140-
- create-all
141-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
142-
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPublic --stage apply --verbose']
143-
- id: verify simple-autopilot-public-local
144-
waitFor:
145-
- apply simple-autopilot-public-local
146-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
147-
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPublic --stage verify --verbose']
148-
- id: destroy simple-autopilot-public-local
149-
waitFor:
150-
- verify simple-autopilot-public-local
151-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
152-
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPublic --stage teardown --verbose']
153-
- id: apply private-zonal-with-networking
154-
waitFor:
155-
- create-all
156-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
157-
args: ['/bin/bash', '-c', 'cft test run TestPrivateZonalWithNetworking --stage apply --verbose --test-dir test/integration']
158-
- id: verify private-zonal-with-networking
159-
waitFor:
160-
- apply private-zonal-with-networking
161-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
162-
args: ['/bin/bash', '-c', 'cft test run TestPrivateZonalWithNetworking --stage verify --verbose --test-dir test/integration']
163-
- id: teardown private-zonal-with-networking
164-
waitFor:
165-
- verify private-zonal-with-networking
166-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
167-
args: ['/bin/bash', '-c', 'cft test run TestPrivateZonalWithNetworking --stage teardown --verbose --test-dir test/integration']
168-
- id: apply simple-autopilot-private-non-default-sa
169-
waitFor:
170-
- create-all
171-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
172-
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPrivateNonDefaultSA --stage apply --verbose']
173-
- id: verify simple-autopilot-private-non-default-sa
174-
waitFor:
175-
- apply simple-autopilot-private-non-default-sa
176-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
177-
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPrivateNonDefaultSA --stage verify --verbose']
178-
- id: teardown simple-autopilot-private-non-default-sa
179-
waitFor:
180-
- verify simple-autopilot-private-non-default-sa
181-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
182-
args: ['/bin/bash', '-c', 'cft test run TestSimpleAutopilotPrivateNonDefaultSA --stage teardown --verbose']
183-
- id: apply simple-fleet-app-operator-permissions
184-
waitFor:
185-
- create-all
186-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
187-
args: ['/bin/bash', '-c', 'cft test run TestSimpleFleetAppOperatorPermissions --stage apply --verbose']
188-
- id: verify simple-fleet-app-operator-permissions
189-
waitFor:
190-
- apply simple-fleet-app-operator-permissions
191-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
192-
args: ['/bin/bash', '-c', 'cft test run TestSimpleFleetAppOperatorPermissions --stage verify --verbose']
193-
- id: teardown simple-fleet-app-operator-permissions
194-
waitFor:
195-
- verify simple-fleet-app-operator-permissions
196-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
197-
args: ['/bin/bash', '-c', 'cft test run TestSimpleFleetAppOperatorPermissions --stage teardown --verbose']
19847
tags:
19948
- 'ci'
20049
- 'integration'

examples/node_pool/main.tf

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

4847
node_pools = [
4948
{

test/integration/go.mod

Lines changed: 2 additions & 2 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
@@ -116,7 +117,6 @@ require (
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
120120
golang.org/x/sys v0.28.0 // indirect
121121
golang.org/x/term v0.27.0 // indirect
122122
golang.org/x/text v0.21.0 // indirect

test/integration/node_pool/node_pool_test.go

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@ package node_pool
1515

1616
import (
1717
"fmt"
18-
"slices"
1918
"testing"
2019
"time"
2120

2221
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/cai"
23-
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2422
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2523
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
26-
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/utils"
27-
"github.com/gruntwork-io/terratest/modules/k8s"
2824
"github.com/stretchr/testify/assert"
2925
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
3026
)
@@ -44,27 +40,23 @@ func TestNodePool(t *testing.T) {
4440
clusterName := bpt.GetStringOutput("cluster_name")
4541
randomString := bpt.GetStringOutput("random_string")
4642
kubernetesEndpoint := bpt.GetStringOutput("kubernetes_endpoint")
43+
serviceAccount := bpt.GetStringOutput("service_account")
4744

4845
// Retrieve Project CAI
4946
projectCAI := cai.GetProjectResources(t, projectId, cai.WithAssetTypes([]string{"container.googleapis.com/Cluster", "k8s.io/Node"}))
50-
t.Log(projectCAI.Raw)
51-
// Retrieve Cluster from CAI
52-
clusterResourceName := fmt.Sprintf("//container.googleapis.com/projects/%s/locations/%s/clusters/%s", projectId, location, clusterName)
53-
54-
if !projectCAI.Get("#(name=\"" + clusterResourceName + "\").resource.data").Exists() {
55-
t.Fatalf("Cluster not found: %s", clusterResourceName)
56-
}
5747

58-
cluster := projectCAI.Get("#(name=\"" + clusterResourceName + "\").resource.data")
59-
t.Log(cluster.Raw)
48+
// Retrieve Cluster from CAI
6049
// Equivalent gcloud describe command (classic)
6150
// cluster := gcloud.Runf(t, "container clusters describe %s --zone %s --project %s", clusterName, location, projectId)
51+
clusterResourceName := fmt.Sprintf("//container.googleapis.com/projects/%s/locations/%s/clusters/%s", projectId, location, clusterName)
52+
cluster := projectCAI.Get("#(name=\"" + clusterResourceName + "\").resource.data")
53+
6254

6355
// Cluster Assertions (classic)
6456
assert.Contains([]string{"RUNNING", "RECONCILING"}, cluster.Get("status").String(), "Cluster is Running")
6557
assert.Equal("COS_CONTAINERD", cluster.Get("autoscaling.autoprovisioningNodePoolDefaults.imageType").String(), "has the expected image type")
6658
assert.Equal("https://www.googleapis.com/auth/cloud-platform", cluster.Get("autoscaling.autoprovisioningNodePoolDefaults.oauthScopes.0").String(), "has the expected oauth scopes")
67-
assert.Equal("default", cluster.Get("autoscaling.autoprovisioningNodePoolDefaults.serviceAccount").String(), "has the expected service account")
59+
assert.Equal(serviceAccount, cluster.Get("autoscaling.autoprovisioningNodePoolDefaults.serviceAccount").String(), "has the expected service account")
6860
assert.Equal("OPTIMIZE_UTILIZATION", cluster.Get("autoscaling.autoscalingProfile").String(), "has the expected autoscaling profile")
6961
assert.True(cluster.Get("autoscaling.enableNodeAutoprovisioning").Bool(), "has the expected node autoprovisioning")
7062
assert.JSONEq(`[
@@ -81,25 +73,16 @@ func TestNodePool(t *testing.T) {
8173
]`,
8274
cluster.Get("autoscaling.resourceLimits").String(), "has the expected resource limits")
8375

84-
// Cluster Assertions using golden image (TestNodePool.json) with sanitizer
76+
// Setup golden image with sanitizer
8577
g := golden.NewOrUpdate(t, cluster.String(),
78+
golden.WithSanitizer(golden.StringSanitizer(serviceAccount, "SERVICE_ACCOUNT")),
8679
golden.WithSanitizer(golden.StringSanitizer(projectId, "PROJECT_ID")),
8780
golden.WithSanitizer(golden.StringSanitizer(randomString, "RANDOM_STRING")),
8881
golden.WithSanitizer(golden.StringSanitizer(kubernetesEndpoint, "KUBERNETES_ENDPOINT")),
8982
)
90-
checkPaths := utils.GetTerminalJSONPaths(g.GetJSON())
91-
92-
exemptPaths := []string{"nodePools"}
93-
checkPaths = slices.DeleteFunc(checkPaths, func(s string) bool {
94-
return slices.Contains(exemptPaths, s)
95-
})
96-
g.JSONPathEqs(assert, cluster, checkPaths)
9783

98-
// NodePool Assertions
99-
nodePools := []string{"pool-01", "pool-02", "pool-03", "pool-04", "pool-05"}
100-
for _, nodePool := range nodePools {
101-
g.JSONPathEqs(assert, cluster.Get(fmt.Sprintf("nodePools.#(name==%s).name", nodePool)), utils.GetTerminalJSONPaths(g.GetJSON().Get(fmt.Sprintf("nodePools.#(name==%s).name", nodePool))))
102-
}
84+
// Cluster Assertions
85+
testutils.TGKEAssertGolden(t, assert, g, &cluster, []string{"pool-01", "pool-02", "pool-03", "pool-04", "pool-05"}, []string{"monitoringConfig.componentConfig.enableComponents"})
10386

10487
// nodePool-01 Assertions
10588
assert.Equal("pool-01", cluster.Get("nodePools.#(name==\"pool-01\").name").String(), "pool-1 exists")
@@ -161,11 +144,6 @@ func TestNodePool(t *testing.T) {
161144
assert.True(cluster.Get("nodePools.#(name==\"pool-05\").config.advancedMachineFeatures.enableNestedVirtualization").Bool(), "has enable_nested_virtualization enabled")
162145

163146
// K8s Assertions
164-
gcloud.Runf(t, "container clusters get-credentials %s --region %s --project %s", clusterName, location, projectId)
165-
k8sOpts := k8s.KubectlOptions{}
166-
clusterNodesOp, err := k8s.RunKubectlAndGetOutputE(t, &k8sOpts, "get", "nodes", "-o", "json")
167-
assert.NoError(err)
168-
clusterNodes := utils.ParseKubectlJSONResult(t, clusterNodesOp)
169147
assert.JSONEq(`[
170148
{
171149
"effect": "PreferNoSchedule",
@@ -178,7 +156,7 @@ func TestNodePool(t *testing.T) {
178156
"value": "true"
179157
}
180158
]`,
181-
clusterNodes.Get("items.#(metadata.labels.node_pool==\"pool-01\").spec.taints").String(), "has the expected taints")
159+
projectCAI.Get("#(resource.data.metadata.labels.node_pool==\"pool-01\").resource.data.spec.taints").String(), "has the expected taints")
182160
assert.JSONEq(`[
183161
{
184162
"effect": "PreferNoSchedule",
@@ -191,7 +169,7 @@ func TestNodePool(t *testing.T) {
191169
"value": "present"
192170
}
193171
]`,
194-
clusterNodes.Get("items.#(metadata.labels.node_pool==\"pool-02\").spec.taints").String(), "has the expected all-pools-example taint")
172+
projectCAI.Get("#(resource.data.metadata.labels.node_pool==\"pool-02\").resource.data.spec.taints").String(), "has the expected all-pools-example taint")
195173
assert.JSONEq(`[
196174
{
197175
"effect": "PreferNoSchedule",
@@ -204,7 +182,7 @@ func TestNodePool(t *testing.T) {
204182
"value": "gvisor"
205183
}
206184
]`,
207-
clusterNodes.Get("items.#(metadata.labels.node_pool==\"pool-03\").spec.taints").String(), "has the expected all-pools-example taint")
185+
projectCAI.Get("#(resource.data.metadata.labels.node_pool==\"pool-03\").resource.data.spec.taints").String(), "has the expected all-pools-example taint")
208186
})
209187

210188
bpt.Test()

test/integration/node_pool/testdata/TestNodePool.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
"https://www.googleapis.com/auth/userinfo.email",
222222
"https://www.googleapis.com/auth/cloud-platform"
223223
],
224-
"serviceAccount": "gke-sa-int-test-p1-8220@PROJECT_ID.iam.gserviceaccount.com",
224+
"serviceAccount": "SERVICE_ACCOUNT",
225225
"shieldedInstanceConfig": {
226226
"enableIntegrityMonitoring": true
227227
},
@@ -354,7 +354,7 @@
354354
"oauthScopes": [
355355
"https://www.googleapis.com/auth/cloud-platform"
356356
],
357-
"serviceAccount": "gke-sa-int-test-p1-8220@PROJECT_ID.iam.gserviceaccount.com",
357+
"serviceAccount": "SERVICE_ACCOUNT",
358358
"shieldedInstanceConfig": {
359359
"enableIntegrityMonitoring": true
360360
},
@@ -451,7 +451,7 @@
451451
"oauthScopes": [
452452
"https://www.googleapis.com/auth/cloud-platform"
453453
],
454-
"serviceAccount": "gke-sa-int-test-p1-8220@PROJECT_ID.iam.gserviceaccount.com",
454+
"serviceAccount": "SERVICE_ACCOUNT",
455455
"shieldedInstanceConfig": {
456456
"enableIntegrityMonitoring": true
457457
},
@@ -541,7 +541,7 @@
541541
"sandboxConfig": {
542542
"type": "GVISOR"
543543
},
544-
"serviceAccount": "gke-sa-int-test-p1-8220@PROJECT_ID.iam.gserviceaccount.com",
544+
"serviceAccount": "SERVICE_ACCOUNT",
545545
"shieldedInstanceConfig": {
546546
"enableIntegrityMonitoring": true
547547
},
@@ -632,7 +632,7 @@
632632
"reservationAffinity": {
633633
"consumeReservationType": "NO_RESERVATION"
634634
},
635-
"serviceAccount": "default",
635+
"serviceAccount": "SERVICE_ACCOUNT",
636636
"shieldedInstanceConfig": {
637637
"enableIntegrityMonitoring": true
638638
},
@@ -724,7 +724,7 @@
724724
"oauthScopes": [
725725
"https://www.googleapis.com/auth/cloud-platform"
726726
],
727-
"serviceAccount": "gke-sa-int-test-p1-8220@PROJECT_ID.iam.gserviceaccount.com",
727+
"serviceAccount": "default",
728728
"shieldedInstanceConfig": {
729729
"enableIntegrityMonitoring": true
730730
},

0 commit comments

Comments
 (0)