Skip to content

Commit

Permalink
Simplify getting service account from cluster.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobgy committed Aug 8, 2019
1 parent 83b9ae6 commit df5a1c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/presubmit-tests-with-pipeline-deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ source "${DIR}/install-argo.sh"
# When project is not ml-pipeline-test, VMs need permission to fetch some images in gcr.io/ml-pipeline-test.
if [ ! "$PROJECT" == "ml-pipeline-test" ]; then
echo "Granting VM service account roles to access gcr.io/ml-pipeline-test"
CLUSTER_SERVICE_ACCOUNT=`gcloud container clusters describe "${TEST_CLUSTER}" --format json | grep -oP '"serviceAccount".*' | head -n 1 | sed -E 's/.*: "(.*)"$/\1/g'`
CLUSTER_SERVICE_ACCOUNT=`gcloud container clusters describe "${TEST_CLUSTER}" --format 'value(nodeConfig.serviceAccount)'`
echo "CLUSTER_SERVICE_ACCOUNT=${CLUSTER_SERVICE_ACCOUNT}"
gcloud projects add-iam-policy-binding ml-pipeline-test --member serviceAccount:${CLUSTER_SERVICE_ACCOUNT} --role roles/storage.objectViewer
fi
Expand Down

0 comments on commit df5a1c8

Please sign in to comment.