Skip to contentSkip to conversation

gce-xfstests: fix setup iam policy binding

PATCH New Amir Goldstein 1 participant 1 message Aug 18, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gce-xfstests: fix setup iam policy binding

On a new account setup. gce-xfstests setup failed with error:

"Failed to add iam policy binding for roles/..."

On the second (verbose) retry, the opertaion succeeds, but the script still aborts.

Fix a typo in the first invocation of the command.

---
 run-fstests/util/gce-do-setup | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
run-fstests/util/gce-do-setup +2 -2
index c06a1e9..037068e 100755
@@ -141,9 +141,9 @@ function SetupServiceAccount () {
 		   --display-name "$name"
 	if ! run_gcloud projects add-iam-policy-binding "$GCE_PROJECT" \
 	     --member "serviceAccount:$srv_acct" \
-	     --role "projects/$GCE_PROJECT/roles/$role" \
+	     --role "$role" \
 	     --verbosity none >& /dev/null ; then
-	    echo "Failed to add iam policy binding for roles/$role"
+	    echo "Failed to add iam policy binding for role $role"
 	    # Re-run to get error message
 	    run_gcloud projects add-iam-policy-binding "$GCE_PROJECT" \
 		       --member "serviceAccount:$srv_acct" \
Signature · 1 line
2.25.1