Skip to content

Commit

Permalink
Merge pull request #15821 from fejta/bake
Browse files Browse the repository at this point in the history
Ensure identity bound successfully
  • Loading branch information
k8s-ci-robot authored Jan 9, 2020
2 parents 6625b17 + 3b8595b commit 7d05f94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
18 changes: 17 additions & 1 deletion experiment/workload-identity/bind-service-accounts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ done
--role=roles/iam.workloadIdentityUser \
"--member=$want" \
$gcp_service_account
)
) > /dev/null

pod-identity() {
(
set -o xtrace
kubectl run --rm=true -i --generator=run-pod/v1 \
"--context=$context" "--namespace=$namespace" "--serviceaccount=$name" \
--image=google/cloud-sdk:slim workload-identity-test \
<<< "gcloud config get-value core/account"
) | head -n 1
}

got=$(pod-identity 2> >(grep -v "try pressing enter"))
if [[ "$got" != "$gcp_service_account" ]]; then
echo "Bad identity, got $got, want $gcp_service_account" >&2
exit 1
fi

echo DONE
1 change: 1 addition & 0 deletions experiment/workload-identity/enable-workload-identity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ case $ans in
y*|Y*)
;;
*)
echo "ABORTING" >&2
exit 1
;;
esac
Expand Down

0 comments on commit 7d05f94

Please sign in to comment.