Google cloud platform 在GCP中的工件注册表上设置IAM策略时出现权限错误

Google cloud platform 在GCP中的工件注册表上设置IAM策略时出现权限错误,google-cloud-platform,google-cloud-iam,Google Cloud Platform,Google Cloud Iam,我在遵循指南,在第三步就卡住了。当我跑的时候 gcloud artifacts repositories add-iam-policy-binding [myrepo] \ --location us \ --member=serviceAccount:build-robot@[myproject].iam.gserviceaccount.com \ --role=roles/artifactregistry.writer 我获得权限\u被拒绝:呼叫者没有权限 gcloud以角色/所有者(我自

我在遵循指南,在第三步就卡住了。当我跑的时候

gcloud artifacts repositories add-iam-policy-binding [myrepo] \
--location us \
--member=serviceAccount:build-robot@[myproject].iam.gserviceaccount.com \
--role=roles/artifactregistry.writer
我获得
权限\u被拒绝:呼叫者没有权限

gcloud以角色/所有者(我自己)的身份运行,因此我绝对有权执行该操作


我可以使用role
roles/cloudbuild.builds.builder
为服务帐户添加一个项目绑定,这很有效(我可以使用build robot服务帐户从工件注册表推拉图像),但是对于我希望服务帐户执行的操作来说,它太过宽松。

有时,由于
--location
标记中指定的位置不正确,可能会发生此错误


检查您授予权限的工件是否在美国,因为您共享的教程假定您已在美国创建该工件,或者相应地更改位置标记。

有时,由于
--location
标记中的指定位置不正确,可能会发生此错误


检查您授予权限的工件是否在美国,因为您共享的教程假设您在美国创建了它,或者相应地更改了位置标记。

成功了!需要指定location=“us-central1”,而不仅仅是指定的“us”!需要指定location=“us-central1”而不仅仅是“us”