mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Further error handling when gcloud isn't set up correctly.
This commit is contained in:
parent
b78e32b1ba
commit
87afb5fd5e
@ -19,8 +19,18 @@ if [ "$(which gcloud)" == "" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$(gcloud auth list 2>&1 | grep 'No credentialed accounts')" ]; then
|
||||||
|
gcloud auth login
|
||||||
|
fi
|
||||||
|
|
||||||
PROJECT=$(gcloud config list project | tail -n 1 | cut -f 3 -d ' ')
|
PROJECT=$(gcloud config list project | tail -n 1 | cut -f 3 -d ' ')
|
||||||
|
|
||||||
|
if [ ! -n "$PROJECT" ]; then
|
||||||
|
echo "Default project is not set."
|
||||||
|
echo "Please run gcloud config set project <project>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if which md5 > /dev/null; then
|
if which md5 > /dev/null; then
|
||||||
HASH=$(md5 -q -s $PROJECT)
|
HASH=$(md5 -q -s $PROJECT)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user