Following this Quickstart I set a default project like this
$ gcloud config set project lfs258
Updated property [core/project].
$ gcloud config get-value project
lfs258
The project lfs258 doesn't exist on my GCP account, though, so I'm surprised that I could set it as the default. When I try to see where gcloud stores its defaults there is no .gcloud/
directory.
Where does gcloud store its defaults? kubectl
stores them in .kube/config
but I can't find a similar config file for gcloud.
To be more specific gcloud
supports multiple configurations. Run
gcloud config configurations list
to see full list.
If user did not create configuration explicitly he/she gets configuartion named default
, and as a result properties set via
gcloud config set ...
command will get stored in
~/.config/gcloud/configurations/config_default
If you create new configuration
gcloud config configurations create my_settings
then properties will be stored in
~/.config/gcloud/configurations/config_my_settings
Note as a user you should not care where they are stored, and if you need to programatically access them a better option is to run
gcloud config list --format=json
you can even access specific configuration (not just currently selected) by doing
gcloud config list --format=json --configuration=my_setting