Skip to content

Commit

Permalink
GCP - get checks the command
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrildiagne committed Oct 12, 2019
1 parent 45275b8 commit 23f9681
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions images/providers/gcp/get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,20 @@ source $KUDA_CMD_DIR/.config.sh
gcloud container clusters get-credentials $KUDA_GCP_CLUSTER_NAME

function prop() {
echo -e "\e[1m$1 : \e[34m $2 \e[0m"
echo -e "-\e[1m $1 : \e[36m $2 \e[0m"
}

# Print the IP Adress of the cluster.
APP_IP_ADDRESS=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
prop "IP" $APP_IP_ADDRESS
function get_status() {
echo -e "\n\e[1mStatus:"
# Print the IP Adress of the cluster.
APP_IP_ADDRESS=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
prop "IP" $APP_IP_ADDRESS
}

case $1 in
status) get_status ;;
*)
echo "ERROR: command $1 unknown."
exit
;;
esac

0 comments on commit 23f9681

Please sign in to comment.