【问题标题】:Permission error when setting IAM policy on Artifact Registry in GCP在 GCP 中对 Artifact Registry 设置 IAM 政策时出现权限错误
【发布时间】:2021-03-29 13:56:05
【问题描述】:

我正在关注 this 指南并在第 3 步卡住。当我运行时

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

我收到PERMISSION_DENIED: The caller does not have permission

gcloud 作为角色/所有者(我自己)运行,所以我绝对有权执行该操作。

我可以为具有角色roles/cloudbuild.builds.builder 的服务帐户添加项目绑定,这很有效(我可以使用 build-robot 服务帐户从工件注册表中推送和拉取图像),但对于我的内容来说过于宽松了想要服务帐户执行此操作。

【问题讨论】:

    标签: google-cloud-platform google-cloud-iam


    【解决方案1】:

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

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

    【讨论】:

    • 做到了!需要指定 location="us-central1" 而不仅仅是“us”
    猜你喜欢
    • 2019-06-11
    • 2021-01-14
    • 1970-01-01
    • 2020-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-02
    相关资源
    最近更新 更多