英文:
Cannot create a Cloud Build trigger with Cloud Build repositories 2nd gen - permissions error
问题
我一直在遵循https://cloud.google.com/build/docs/automating-builds/github/connect-repo-github?generation=2nd-gen上的说明,从与Cloud Build存储库第2代连接的GitHub存储库创建Cloud Build触发器。
无论我是否像说明中那样使用gcloud,使用Google Cloud Console UI,甚至尝试通过Terraform编程方式,我都会收到相同的错误。
我无法确定是否需要在某个地方设置权限,还是只是一个误导性的错误,GitHub权限有问题。我的用户帐户具有roles/cloudbuild.connectionAdmin
角色。我看不出为什么提到的权限不应存在。
无法获取存储库项目/my-project/locations/us-central1/connections/my-app-github-connection/repositories/MyApp的连接:generic::permission_denied:对项目/my-project-number/locations/us-central1/connections/my-app-github-connection的权限 'cloudbuild.connections.get' 被拒绝
这是Cloud Build服务帐户被授予的角色:
有任何想法吗?
英文:
I have been following the instructions at https://cloud.google.com/build/docs/automating-builds/github/connect-repo-github?generation=2nd-gen to create a Cloud Build Trigger from a GitHub repo connected to Cloud Build repositories 2nd gen.
Whether I use gcloud as in the instructions, use the Google Cloud Console UI or even try programmatically via Terraform, I get the same error.
I cannot work out if I need to set permissions somewhere or if it is just a misleading error and something is wrong with the GitHub permissions. My user account has the roles/cloudbuild.connectionAdmin
role. I cannot see why the mentioned permission would not be there.
connection of repository projects/my-project/locations/us-central1/connections/my-app-github-connection/repositories/MyApp cannot be fetched: generic::permission_denied: Permission 'cloudbuild.connections.get' denied on 'projects/my-project-number/locations/us-central1/connections/my-app-github-connection'
Here is the roles the Cloud Build service account has granted:
Any ideas?
答案1
得分: 1
明白了,在下面的屏幕上,我必须启用秘密管理器秘密访问器。
我一直在为以下内容添加权限:
service-262018307079@gcp-sa-cloudbuild.iam.gserviceaccount.com
而不是:
262018307079@cloudbuild.gserviceaccount.com
。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论