【发布时间】:2026-01-28 15:15:01
【问题描述】:
我正在尝试使用 gitlab ci 中的 for 循环删除对谷歌云功能的某些权限。
for i in ${!CFS[@]}; do
gcloud functions remove-iam-policy-binding ${API_VERSION}-${CFS[$i]} --member=${MEMBER} --role=${ROLE}
done
问题是,如果资源没有给定的角色,对于该成员,我会收到错误消息。
ERROR: (gcloud.functions.remove-iam-policy-binding) Policy binding with the specified member and role not found!.
我想通过在执行remove-iam-policy-binding gcloud 命令之前检查成员是否在资源上具有给定角色来避免这种情况。有没有办法在删除之前检查给定资源上的成员是否存在权限?
【问题讨论】:
标签: google-cloud-platform google-cloud-functions gitlab-ci gcloud google-iam