#!/usr/bin/env bash export CLUSTER_NAME=o11y-logtest export CLUSTER_PROJECT_ID=ret-edge-o11y-sandbox export CLUSTER_PROVIDER=generic export CLUSTER_UUID=33c03ca7-23ef-4429-a3f3-ceb3acf56983 export CLUSTER_LOCATION=us-east1-b # ret-edge-pz32l4f02ads5zi6ux91w == dev1-engineering2 export GCP_PROJECT_ID=ret-edge-pz32l4f02ads5zi6ux91w export FOREMAN_GCP_PROJECT_ID=ret-edge-dev1-foreman export GCP_REGION=us-east1 export GCP_ZONE=b export RED='\033[0;31m' export GREEN='\033[0;32m' export MAG='\033[0;35m' export NC='\033[0m' #no color echo -e "${MAG}Setting kube context to $CLUSTER_NAME${NC}" gcloud container clusters get-credentials "$CLUSTER_NAME" --zone "$CLUSTER_LOCATION" --project "$CLUSTER_PROJECT_ID" CURRENT_CONTEXT=$(kubectl config current-context) export CURRENT_CONTEXT verify_environment() { echo -e "Verifying env...." echo -e "\nAre you sure you want to run this command on cluster ${RED}$CURRENT_CONTEXT${NC}? [Y/n] \c" read -r ANSWER if [[ ! "$ANSWER" =~ ^([yY][eE][sS]|[yY])$ ]]; then echo -e "quitting..." exit 1 fi }