Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform gcloud在哪里存储其默认值?_Google Cloud Platform_Google Compute Engine_Gcloud - Fatal编程技术网

Google cloud platform gcloud在哪里存储其默认值?

Google cloud platform gcloud在哪里存储其默认值?,google-cloud-platform,google-compute-engine,gcloud,Google Cloud Platform,Google Compute Engine,Gcloud,下面我设置了一个如下的默认项目 $ gcloud config set project lfs258 Updated property [core/project]. $ gcloud config get-value project lfs258 不过,我的GCP帐户上不存在lfs258项目,所以我很惊讶我能将其设置为默认值。当我试图查看gcloud在哪里存储其默认值时,没有.gcloud/目录 gcloud在哪里存储其默认值kubectl将它们存储在.kube/config中,但我找不到类

下面我设置了一个如下的默认项目

$ gcloud config set project lfs258
Updated property [core/project].
$ gcloud config get-value project
lfs258
不过,我的GCP帐户上不存在lfs258项目,所以我很惊讶我能将其设置为默认值。当我试图查看gcloud在哪里存储其默认值时,没有
.gcloud/
目录


gcloud在哪里存储其默认值
kubectl
将它们存储在
.kube/config
中,但我找不到类似的gcloud配置文件。

它存储在
~/.config/gcloud/configurations/config\u default
中,更具体地说,
gcloud
支持多种配置。跑

gcloud config configurations list
查看完整列表

如果用户没有显式创建配置,他/她将获得名为
default
的配置,结果通过

gcloud config set ...
命令将存储在

~/.config/gcloud/configurations/config_default
如果您创建新配置

gcloud config configurations create my_settings
然后属性将存储在

~/.config/gcloud/configurations/config_my_settings
注意:作为一个用户,您不应该关心它们存储在哪里,如果您需要通过编程访问它们,更好的选择是运行

gcloud config list --format=json
您甚至可以通过执行以下操作来访问特定的配置(而不仅仅是当前选择的)


为了更通用,您可以始终运行
gcloud info
打印一组诊断信息,以显示所有配置文件和位置以及日志等。下面是my environment上的
gcloud info
输出,您可以在中看到配置文件 用户配置目录:

$gcloud info
谷歌云SDK[239.0.0]
平台:[Mac OS X,x86_64]('Darwin','foorbar.local','18.2.0','Darwin内核版本18.2.0:Thu Dec 20:46:53 PST 2018;root:xnu-4903.241.1~1/RELEASE_x86_64','x86_64','i386')
Python版本:[2.7.15(默认值,2018年11月27日,21:40:55)[GCC 4.2.1兼容Apple LLVM 10.0.0(clang-1000.11.45.5)]]
Python位置:[/usr/local/opt/python@2/垃圾箱/蟒蛇2.7]
网站包:[已启用]
安装根:[/Users/devy/.googlecloudsdk]
已安装组件:
库贝特尔:[2019.03.17]
核心:[2019.03.17]
gcloud:[]
docker凭证gcr:[]
gsutil:[4.37]
bq:[2.0.42]
阿尔法:[2019.02.22]
系统路径:[已编辑]
Python路径:[已编辑]
路径上的云SDK:[正确]
路径上的Kubectl:[/usr/local/bin/Kubectl]
安装属性:[/Users/devy/.googlecloudsdk/Properties]
用户配置目录:[/Users/devy/.Config/gcloud]
活动配置名称:[默认值]
活动配置路径:[/Users/devy/.config/gcloud/configurations/config\u default]
账户:[devy@foobar.com]
项目:[富吧]
当前属性:
[核心]
项目:[富吧]
账户:[devy@foobar.com]
禁用使用情况报告:[True]
[货柜]
集群:[foobar]
[计算]
地区:[美国中部1]
区域:[us-central1-a]
日志目录:[/Users/devy/.config/gcloud/Logs]
最后一个日志文件:[/Users/devy/.config/gcloud/logs/2019.03.19/16.39.09.777341.Log]
git:[git版本2.19.1]
ssh:[OpenSSH_7.9p1,LibreSSL 2.7.3]
在这种特殊情况下,您可以运行
gcloud info | grep“User Config”
来列出配置文件的位置,无论您是否自定义安装

gcloud config list --format=json --configuration=my_setting