简体   繁体   English

在 GCP 中对 Artifact Registry 设置 IAM 政策时出现权限错误

[英]Permission error when setting IAM policy on Artifact Registry in GCP

I'm following this guide and getting stuck at step 3. When I run我正在遵循指南并卡在第 3 步。当我运行时

gcloud artifacts repositories add-iam-policy-binding [myrepo] \
--location us \
--member=serviceAccount:build-robot@[myproject].iam.gserviceaccount.com \
--role=roles/artifactregistry.writer

I get PERMISSION_DENIED: The caller does not have permission .我得到PERMISSION_DENIED: The caller does not have permission

gcloud is running as roles/Owner (myself) so I definitely have permission to perform the action. gcloud 作为角色/所有者(我自己)运行,所以我绝对有权执行该操作。

I can add a project binding for the service account with role roles/cloudbuild.builds.builder , and this works (I can push and pull images from the artifact registry using the build-robot service account), but is far too permissive for what I want the service account to do.我可以使用角色roles/cloudbuild.builds.builder为服务帐户添加项目绑定,这很有效(我可以使用 build-robot 服务帐户从工件注册表中推送和拉取图像),但是对于什么来说太宽容了我想要服务帐户来做。

Sometimes this error may happen due to the specified location in the --location tag not being the correct one.有时,由于--location标签中的指定位置不正确,可能会发生此错误。

Check that the artifact to which you're granting permissions is in US, as the tutorial you shared assumes you've created it in US, or otherwise change the location tag accordingly.检查您授予权限的工件是否在美国,因为您共享的教程假定您已在美国创建它,或者相应地更改位置标签。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 terraform 计划时检索 IAM 策略 GCP 时出错? - Error retrieving IAM policy GCP when terraform plan? Terraform 抛出为服务帐户设置 IAM 策略时出错...需要权限 iam.serviceAccounts.setIamPolicy - Terraform throws Error setting IAM policy for service account ... Permission iam.serviceAccounts.setIamPolicy is required 尝试在 gcp 中使用 set iam policy 方法使用 python 更新云存储策略时出错? - Getting an error when trying to use set iam policy method in gcp to update cloud storage policy using python? 使用端点设置云功能时,绑定IAM策略时出错 - Error binding IAM policy when setting up cloud functions with endpoints 在不同的 GCP 项目中使用工件注册表时,GCP 工件注册表找不到满足要求的版本 - GCP artifact registry cannot find a version that satisfies the requirement when using artifact registry in different GCP project 使用纱线从 GCP 工件注册表安装 npm 包时如何修复 404 错误? - How to fix 404 error when installing npm package from GCP artifact registry with yarn? 请求有无效的参数错误上传到 python 工件注册表 [gcp] - Request has invalid argument Error on uploading to python Artifact Registry [gcp] GCP Artifact Registry - 仅在 repo 不存在时创建 - GCP Artifact Registry - create repo only when it does not exist 从打包程序实例导入时,GCP yum 工件注册表 403 - GCP yum artifact registry 403 when imported from packer instance 在 gcp 工件注册表中构建依赖项 - Build with dependency in gcp artifact registry
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM