You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ccoct gcp create functions occassionaly fail when recently created
resources have not yet replicated in the cloud. This change adds retry
functionality to increase success rate when this happens.
ifstrings.Contains(err.Error(), "Service account "+serviceAccount.Email+" does not exist") {
295
+
// The service account just created can't be found yet due to a replication delay so we need to retry.
296
+
ifi>=23 {
297
+
log.Fatal("Timed out adding predefined roles to IAM service account, this is most likely due to a replication delay following creation of the service account, please retry")
298
+
break
299
+
} else {
300
+
log.Printf("Unable to add predefined roles to IAM service account, retrying...")
301
+
time.Sleep(10*time.Second)
302
+
continue
303
+
}
304
+
}
305
+
306
+
return"", errors.Wrap(err, fmt.Sprintf("Failed to add predefined roles for IAM service account %s", serviceAccount.DisplayName))
307
+
}
291
308
}
292
309
293
310
// Add member <-> role bindings for the IAM service account
0 commit comments