Skip to content

Commit

Permalink
fix: remove the set project id
Browse files Browse the repository at this point in the history
  • Loading branch information
ericyz committed Sep 12, 2023
1 parent d655b1a commit 442d96e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/integration/beta_cluster/beta_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ func TestBetaCluster(t *testing.T) {
location := gke.GetStringOutput("location")
clusterName := gke.GetStringOutput("cluster_name")
serviceAccount := gke.GetStringOutput("service_account")
gcloud.Runf(t, "config set project %s", projectId)
// gcloud.Runf(t, "config set project %s", projectId)
op := gcloud.Runf(t, "beta container clusters describe %s --zone %s --project %s", clusterName, location, projectId)
// save output as goldenfile
g := golden.NewOrUpdate(t, op.String(),
golden.WithSanitizer(golden.StringSanitizer(serviceAccount, "SERVICE_ACCOUNT")),
golden.WithSanitizer(golden.StringSanitizer(projectId, "PROJECT_ID")),
golden.WithSanitizer(golden.StringSanitizer(clusterName, "CLUSTER_NAME")),
)

// assert json paths against goldenfile data
validateJSONPaths := []string{
"status",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package simple_regional_with_networking

import (
"strings"
"testing"

"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
Expand All @@ -33,16 +32,16 @@ func TestSimpleRegionalWithNetworking(t *testing.T) {
projectId := bpt.GetStringOutput("project_id")
location := bpt.GetStringOutput("location")
clusterName := bpt.GetStringOutput("cluster_name")
serviceAccount := strings.ReplaceAll(bpt.GetStringOutput("service_account"), projectId, "PROJECT_ID")
serviceAccount := bpt.GetStringOutput("service_account")
region := bpt.GetStringOutput("region")
subnetName := bpt.GetStringOutput("subnet_name")
ipRangeServicesName := bpt.GetStringOutput("ip_range_services_name")
ipRangePodName := bpt.GetStringOutput("ip_range_pods_name")

op := gcloud.Runf(t, "container clusters describe %s --zone %s --project %s", clusterName, location, projectId)
g := golden.NewOrUpdate(t, op.String(),
golden.WithSanitizer(golden.StringSanitizer(projectId, "PROJECT_ID")),
golden.WithSanitizer(golden.StringSanitizer(serviceAccount, "SERVICE_ACCOUNT")),
golden.WithSanitizer(golden.StringSanitizer(projectId, "PROJECT_ID")),
golden.WithSanitizer(golden.StringSanitizer(clusterName, "CLUSTER_NAME")),
)
validateJSONPaths := []string{
Expand Down

0 comments on commit 442d96e

Please sign in to comment.