这让我想把脸埋进我的电脑屏幕:
>gcloud config set project mydom-dev
Updated property [core/project].
>gcloud config list core/project
[core]
project = mydom-dev
Your active configuration is: [default]
>gcloud projects get-iam-policy mydom-dev
API [cloudresourcemanager.googleapis.com] not enabled on project
[mydom-prod]. Would you like to enable and retry? (Y/n)?
为什么mydom-prod?我设置指向我的开发项目,确认它指向我的开发项目但我运行此命令并查看我的prod项目?
编辑:当我查看我的整个配置时,我看到我有一个帐户设置(不记得曾经设置过这个)>gcloud config list
[core]
account = someuser@mydom-prod.iam.gserviceaccount.com
disable_usage_reporting = True
project = mydom-dev
Your active configuration is: [default]
如何取消配置?删除该服务帐户设置并使用我的用户帐户?
答案 0 :(得分:2)
您可以使用gcloud config unset account
:
$ gcloud config -h
Usage: gcloud config [optional flags] <group | command>
group may be configurations
command may be get-value | list | set | unset
$ gcloud config get-value account
my_account@my_domain.com
$ gcloud config unset account
Unset property [core/account].
$ gcloud config get-value account
(unset)
$