mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-10 07:58:07 +00:00
- Create with private IP on shared subnet - Use regular ssh instead of gcloud ssh - Update deps.sh to remove packages that don't exist anymore
27 lines
696 B
Bash
Executable File
27 lines
696 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Copyright 2021-2025 the Pinniped contributors. All Rights Reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set -euo pipefail
|
|
|
|
if [[ -z "${PINNIPED_GCP_PROJECT:-}" ]]; then
|
|
echo "PINNIPED_GCP_PROJECT env var must be set"
|
|
exit 1
|
|
fi
|
|
|
|
if ! gcloud auth print-access-token &>/dev/null; then
|
|
echo "Please run \`gcloud auth login\` and try again."
|
|
exit 1
|
|
fi
|
|
|
|
instance_name="${REMOTE_INSTANCE_NAME:-${USER}}"
|
|
project="$PINNIPED_GCP_PROJECT"
|
|
zone="us-west1-a"
|
|
|
|
# Delete the instance forever. Will prompt for confirmation.
|
|
echo "Destroying VM $instance_name..."
|
|
gcloud compute instances delete "$instance_name" \
|
|
--delete-disks="all" \
|
|
--project="$project" --zone="$zone"
|