Skip to content

Commit

Permalink
Use gke-gcloud-auth-plugin in /.deploystack/test (GoogleCloudPlatform…
Browse files Browse the repository at this point in the history
  • Loading branch information
NimJay authored and mrcrgl committed Sep 11, 2023
1 parent cca99c0 commit 1795654
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .deploystack/test
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function generateProject(){
local __DATELABEL=$(date +%F)
local VALUE=ds-test-$__STACKSUFFIX-$__RANDOMSUFFIX
local __BA=$(gcloud beta billing accounts list --format="value(ACCOUNT_ID)" --limit=1 | xargs)

gcloud projects create $VALUE --labels="deploystack-disposable-test-project=$__DATELABEL" --folder="155265971980"
gcloud beta billing projects link $VALUE --billing-account=$__BA
eval $__resultvar="'$VALUE'"
Expand All @@ -104,6 +104,10 @@ section_open "Generate random test project"
generateProject PROJECT "$suffix"
section_close

# We need to force the use of gke-gcloud-auth-plugin (for GKE authentication)
# if we're using kubectl 1.25 or lower.
export USE_GKE_GCLOUD_AUTH_PLUGIN=True

DIR="terraform"
gcloud services enable cloudresourcemanager.googleapis.com --project=$PROJECT
REGION="us-central1"
Expand Down Expand Up @@ -162,7 +166,7 @@ section_open "Testing Google Kubernetes Engine cluster does NOT exist"
section_close

# This is only needed if you tests fail alot because of overlaping runs of the
# same set of tests. Really don't do this if you don't want to severly irritate
# same set of tests. Really don't do this if you don't want to severly irritate
# @tpryan
section_open "Delete Test Project"
gcloud projects delete $PROJECT -q
Expand Down

0 comments on commit 1795654

Please sign in to comment.