Skip to content

Commit

Permalink
fix handling of gcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Jul 2, 2024
1 parent 0276827 commit eef0f91
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .evergreen/auth_oidc/k8s/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ pushd $SCRIPT_DIR
rm -f secrets-export.sh
. ./setup-secrets.sh

VARIANT=${VARIANT:-"aks"}
VARIANT=$(echo "$VARIANT" | tr '[:upper:]' '[:lower:]')

########################
# Start an Atlas Cluster

Expand Down
3 changes: 1 addition & 2 deletions .evergreen/csfle/gcpkms/create-and-setup-instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export GCPKMS_DISKSIZE=${GCPKMS_DISKSIZE:-"20gb"}

# download-gcloud.sh sets GCPKMS_GCLOUD.
echo "download-gcloud.sh ... begin"
bash $DRIVERS_TOOLS/.evergreen/ensure-binary.sh gcloud
export GCPKMS_GCLOUD=$(which gcloud)
. $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/download-gcloud.sh
echo "download-gcloud.sh ... end"

# Handle login.
Expand Down
15 changes: 15 additions & 0 deletions .evergreen/csfle/gcpkms/download-gcloud.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Download gcloud CLI for Linux 64-bit (x86_64).
# Evergreen scripts must use the expansions.update command to load the expansion.
set -o errexit # Exit on first command error.

if command -v gcloud &> /dev/null; then
echo "gcloud is on the path"
GCPKMS_GCLOUD=gcloud
else
echo "Download gcloud ... begin"
wget -q https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-393.0.0-linux-x86_64.tar.gz
tar xf google-cloud-cli-393.0.0-linux-x86_64.tar.gz
GCPKMS_GCLOUD=$(pwd)/google-cloud-sdk/bin/gcloud
echo "Download gcloud ... end"
fi
3 changes: 1 addition & 2 deletions .evergreen/ensure-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ case $NAME in
BASE="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads"
case "$OS_NAME-$MARCH" in
linux-x86_64)
# Use 393.0.0 for compat with debian 10.
URL="$BASE/google-cloud-cli-393.0.0-linux-x86_64.tar.gz"
URL="$BASE/google-cloud-cli-linux-x86_64.tar.gz"
;;
linux-aarch64)
URL="$BASE/google-cloud-cli-linux-arm.tar.gz"
Expand Down

0 comments on commit eef0f91

Please sign in to comment.