Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use iam-policy value for EMAIL if case-sensitive. #1937

Merged
merged 2 commits into from
Nov 15, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
IAM PR update merge with master.
IMBurbank committed Nov 15, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit befec89c4536b7e8c7eb90aee05d07f8f14abdba
26 changes: 8 additions & 18 deletions scripts/kfctl.sh
Original file line number Diff line number Diff line change
@@ -49,24 +49,6 @@ createEnv() {
echo KUBEFLOW_PLATFORM=gke >> ${ENV_FILE}
echo PROJECT="${PROJECT}" >> ${ENV_FILE}
echo ZONE=${ZONE} >> ${ENV_FILE}

# GCP Email for cert manager
if [ -z "$EMAIL" ]; then
EMAIL=$(gcloud config get-value account 2>/dev/null)
if [ -z "$EMAIL" ]; then
echo "GCP account must be set either using --email <EMAIL>"
echo "or by setting a default account in gcloud config"
exit 1
fi
# Use iam-policy value for EMAIL if case-sensitive
EM_LIST="$(gcloud projects get-iam-policy $PROJECT | grep -io $EMAIL)"
for em in $EM_LIST; do
if [ "$em" != "$EMAIL" ]; then
EMAIL=$em
break
fi
done
fi
echo EMAIL=${EMAIL} >> ${ENV_FILE}

# TODO: Do we need to make PROJECT_NUMBER also a flag like --project-number
@@ -232,6 +214,14 @@ parseArgs() {
echo "or by setting a default account in gcloud config"
exit 1
fi
# Use iam-policy value for EMAIL if case-sensitive
EM_LIST="$(gcloud projects get-iam-policy $PROJECT | grep -io $EMAIL)"
for em in $EM_LIST; do
if [ "$em" != "$EMAIL" ]; then
EMAIL=$em
break
fi
done
fi
fi
}
You are viewing a condensed version of this merge commit. You can view the full changes here.