diff --git a/builder/googlecompute/driver_gce.go b/builder/googlecompute/driver_gce.go index f2adaa591..10ec4e292 100644 --- a/builder/googlecompute/driver_gce.go +++ b/builder/googlecompute/driver_gce.go @@ -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)