Merge pull request #7927 from hashicorp/fix_googlecompute_crash_7921

code changed recently so that sometimes the conf is nil.
This commit is contained in:
Megan Marsh 2019-07-30 09:55:09 -07:00 committed by GitHub
commit f97df6721e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ func NewClientGCE(conf *jwt.Config) (*http.Client, error) {
var client *http.Client
// Auth with AccountFile first if provided
if len(conf.PrivateKey) > 0 {
if conf != nil && len(conf.PrivateKey) > 0 {
log.Printf("[INFO] Requesting Google token via account_file...")
log.Printf("[INFO] -- Email: %s", conf.Email)
log.Printf("[INFO] -- Scopes: %s", DriverScopes)