Skip to content

Commit 039e64d

Browse files
committed
switch to glcoud
1 parent cbfc3ab commit 039e64d

File tree

6 files changed

+74
-195
lines changed

6 files changed

+74
-195
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'

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.27.0 // indirect
121121
golang.org/x/term v0.26.0 // indirect
122122
golang.org/x/text v0.20.0 // indirect

test/integration/node_pool/node_pool_test.go

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@ 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"
2322
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2423
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2524
"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"
2825
"github.com/stretchr/testify/assert"
2926
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
3027
)
@@ -47,18 +44,12 @@ func TestNodePool(t *testing.T) {
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
49+
// clusterResourceName := fmt.Sprintf("//container.googleapis.com/projects/%s/locations/%s/clusters/%s", projectId, location, clusterName)
50+
// cluster := projectCAI.Get("#(name=\"" + clusterResourceName + "\").resource.data")
6051
// Equivalent gcloud describe command (classic)
61-
// cluster := gcloud.Runf(t, "container clusters describe %s --zone %s --project %s", clusterName, location, projectId)
52+
cluster := gcloud.Runf(t, "container clusters describe %s --zone %s --project %s", clusterName, location, projectId)
6253

6354
// Cluster Assertions (classic)
6455
assert.Contains([]string{"RUNNING", "RECONCILING"}, cluster.Get("status").String(), "Cluster is Running")
@@ -87,19 +78,8 @@ func TestNodePool(t *testing.T) {
8778
golden.WithSanitizer(golden.StringSanitizer(randomString, "RANDOM_STRING")),
8879
golden.WithSanitizer(golden.StringSanitizer(kubernetesEndpoint, "KUBERNETES_ENDPOINT")),
8980
)
90-
checkPaths := utils.GetTerminalJSONPaths(g.GetJSON())
9181

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)
97-
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-
}
82+
testutils.TGKEAssertGolden(assert, g, &cluster, []string{"pool-01", "pool-02", "pool-03", "pool-04", "pool-05"}, []string{"monitoringConfig.componentConfig.enableComponents"})
10383

10484
// nodePool-01 Assertions
10585
assert.Equal("pool-01", cluster.Get("nodePools.#(name==\"pool-01\").name").String(), "pool-1 exists")
@@ -161,11 +141,14 @@ func TestNodePool(t *testing.T) {
161141
assert.True(cluster.Get("nodePools.#(name==\"pool-05\").config.advancedMachineFeatures.enableNestedVirtualization").Bool(), "has enable_nested_virtualization enabled")
162142

163143
// 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)
144+
145+
// Equivalent kubectl command (classic)
146+
// gcloud.Runf(t, "container clusters get-credentials %s --region %s --project %s", clusterName, location, projectId)
147+
// k8sOpts := k8s.KubectlOptions{}
148+
// clusterNodesOp, err := k8s.RunKubectlAndGetOutputE(t, &k8sOpts, "get", "nodes", "-o", "json")
149+
// assert.NoError(err)
150+
// clusterNodes := utils.ParseKubectlJSONResult(t, clusterNodesOp)
151+
169152
assert.JSONEq(`[
170153
{
171154
"effect": "PreferNoSchedule",
@@ -178,7 +161,7 @@ func TestNodePool(t *testing.T) {
178161
"value": "true"
179162
}
180163
]`,
181-
clusterNodes.Get("items.#(metadata.labels.node_pool==\"pool-01\").spec.taints").String(), "has the expected taints")
164+
projectCAI.Get("#(resource.data.metadata.labels.node_pool==\"pool-01\").resource.data.spec.taints").String(), "has the expected taints")
182165
assert.JSONEq(`[
183166
{
184167
"effect": "PreferNoSchedule",
@@ -191,7 +174,7 @@ func TestNodePool(t *testing.T) {
191174
"value": "present"
192175
}
193176
]`,
194-
clusterNodes.Get("items.#(metadata.labels.node_pool==\"pool-02\").spec.taints").String(), "has the expected all-pools-example taint")
177+
projectCAI.Get("#(resource.data.metadata.labels.node_pool==\"pool-02\").resource.data.spec.taints").String(), "has the expected all-pools-example taint")
195178
assert.JSONEq(`[
196179
{
197180
"effect": "PreferNoSchedule",
@@ -204,7 +187,7 @@ func TestNodePool(t *testing.T) {
204187
"value": "gvisor"
205188
}
206189
]`,
207-
clusterNodes.Get("items.#(metadata.labels.node_pool==\"pool-03\").spec.taints").String(), "has the expected all-pools-example taint")
190+
projectCAI.Get("#(resource.data.metadata.labels.node_pool==\"pool-03\").resource.data.spec.taints").String(), "has the expected all-pools-example taint")
208191
})
209192

210193
bpt.Test()

test/integration/node_pool/testdata/TestNodePool.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"strategy": "SURGE"
3939
}
4040
},
41-
"autoscalingProfile": "OPTIMIZE_UTILIZATION",
41+
"autoscalingProfile": "OPTIMIZE_UTILIZATIONa",
4242
"enableNodeAutoprovisioning": true,
4343
"resourceLimits": [
4444
{
@@ -715,7 +715,7 @@
715715
"variant": "DEFAULT"
716716
}
717717
},
718-
"machineType": "n1-standard-2",
718+
"machineType": "n1-standard-2a",
719719
"metadata": {
720720
"cluster_name": "node-pool-cluster-RANDOM_STRING",
721721
"disable-legacy-endpoints": "false",

test/integration/safer_cluster_iap_bastion/safer_cluster_iap_bastion_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ func TestSaferClusterIapBastion(t *testing.T) {
3535
// bpt.DefaultVerify(assert)
3636
testutils.TGKEVerify(t, bpt, assert) // Verify Resources
3737

38-
test_command, _ := strings.CutPrefix(bpt.GetStringOutput("test_command"), "gcloud ")
38+
testCommand, _ := strings.CutPrefix(bpt.GetStringOutput("test_command"), "gcloud ")
3939

4040
// pre run ssh command so that ssh-keygen can run
41-
gcloud.RunCmd(t, test_command,
41+
gcloud.RunCmd(t, testCommand,
4242
gcloud.WithCommonArgs([]string{}),
4343
)
4444

45-
cluster_version := fmt.Sprintf("v%s", bpt.GetStringOutput("cluster_version"))
45+
clusterVersion := fmt.Sprintf("v%s", bpt.GetStringOutput("cluster_version"))
4646

47-
op := gcloud.Run(t, test_command,
47+
op := gcloud.Run(t, testCommand,
4848
gcloud.WithCommonArgs([]string{}),
4949
)
5050

51-
assert.Equal(cluster_version, op.Get("gitVersion").String(), "SSH into VM and verify connectivity to GKE")
51+
assert.Equal(clusterVersion, op.Get("gitVersion").String(), "SSH into VM and verify connectivity to GKE")
5252
})
5353

5454
bpt.Test()

0 commit comments

Comments
 (0)