From a43ec709e8034f388aab28d14b97aeed0e7aa98c Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Wed, 16 Jan 2019 21:01:53 +0100 Subject: [PATCH] gcloud: More detailed information about Google Cloud DNS. (#761) --- cmd/cmd_dnshelp.go | 2 +- providers/dns/gcloud/googlecloud.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/cmd_dnshelp.go b/cmd/cmd_dnshelp.go index 9d531d6d..c2dfc164 100644 --- a/cmd/cmd_dnshelp.go +++ b/cmd/cmd_dnshelp.go @@ -51,7 +51,7 @@ Here is an example bash command using the CloudFlare DNS provider: fmt.Fprintln(w, "\tfastdns:\tAKAMAI_HOST, AKAMAI_CLIENT_TOKEN, AKAMAI_CLIENT_SECRET, AKAMAI_ACCESS_TOKEN") fmt.Fprintln(w, "\tgandi:\tGANDI_API_KEY") fmt.Fprintln(w, "\tgandiv5:\tGANDIV5_API_KEY") - fmt.Fprintln(w, "\tgcloud:\tGCE_PROJECT, GCE_SERVICE_ACCOUNT_FILE") + fmt.Fprintln(w, "\tgcloud:\tGCE_PROJECT, 'Application Default Credentials', [GCE_SERVICE_ACCOUNT_FILE]") fmt.Fprintln(w, "\tglesys:\tGLESYS_API_USER, GLESYS_API_KEY") fmt.Fprintln(w, "\tgodaddy:\tGODADDY_API_KEY, GODADDY_API_SECRET") fmt.Fprintln(w, "\thostingde:\tHOSTINGDE_API_KEY, HOSTINGDE_ZONE_NAME") diff --git a/providers/dns/gcloud/googlecloud.go b/providers/dns/gcloud/googlecloud.go index 3efd4a25..d2cd04f4 100644 --- a/providers/dns/gcloud/googlecloud.go +++ b/providers/dns/gcloud/googlecloud.go @@ -61,7 +61,7 @@ func NewDNSProvider() (*DNSProvider, error) { } // Use default credentials. - project := os.Getenv("GCE_PROJECT") + project := env.GetOrDefaultString("GCE_PROJECT", "") return NewDNSProviderCredentials(project) } @@ -98,7 +98,7 @@ func NewDNSProviderServiceAccount(saFile string) (*DNSProvider, error) { // If GCE_PROJECT is non-empty it overrides the project in the service // account file. - project := os.Getenv("GCE_PROJECT") + project := env.GetOrDefaultString("GCE_PROJECT", "") if project == "" { // read project id from service account file var datJSON struct {