作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我的本地 macOS 上,以下命令运行良好:
$ gcloud source repos clone myrepo --project=myproject
(虽然我不确定它是否有效,因为之前我遵循了 ~/.gitcookies
过程)
但是当我在 CE 上这样做时:
$ gcloud source repos clone myrepo --project=myproject
ERROR: (gcloud.source.repos.clone) PERMISSION_DENIED: Request had insufficient authentication scopes.
$ gcloud source repos list
ERROR: (gcloud.source.repos.list) User [<digits>-compute@developer.gserviceaccount.com] does not have permission to access project [<myproject>] (or it may not exist): Request had insufficient authentication scopes.
$ gcloud auth list
Credentialed Accounts
ACTIVE ACCOUNT
* <digits>-compute@developer.gserviceaccount.com
在 IAM 选项卡中,我看到此服务帐户具有“对所有资源的编辑访问权限”,但这没有帮助。即使我添加角色 Source Repository Read+Write。
UPD:我也无法在“角色”选项卡中找到 .clone
角色:
$ gcloud help source repos
COMMANDS
COMMAND is one of the following:
clone
Clone a cloud source repository.
create
Create a cloud source repository.
delete
Delete a cloud source repository.
describe
Describe a cloud source repository.
get-iam-policy
Get the IAM policy for the named cloud source repository.
list
List the repositories the currently active project.
set-iam-policy
Set the IAM policy for the named repository.
但它可能包含在 .get
和我已经尝试过的 Reader
中:
UPD2:sudo/usr/local/share/google/google-cloud-sdk/bin/gcloud components update
没有帮助。
我现在想到的唯一两个选择是要么编辑
(这是我在 Internet 上找到的唯一似乎是解决方案的东西,但那篇博文是用一些东方语言写的,所以我不确定)但它需要 VM 停止,这是 Not Acceptable 。
或者伪造另一个服务帐户,但我不确定在 gcloud
CLI 中切换它不会破坏该机器上运行的其他应用程序。或者也许我可以在克隆 repo 时只使用它一次并且它会坚持下去?
最佳答案
您可以从实例设置中启用对所有云 API 的完全访问权限
。您需要先停止虚拟机。只需单击实例名称,按停止,然后等待,一旦它停止,按编辑并检查 API 访问的适当设置。然后启动实例。
关于google-compute-engine - 如何将存储库从源存储库克隆到 Compute Engine 以在需要时手动提取它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50400975/
我是一名优秀的程序员,十分优秀!