From 07d40c05972bb05ae2e4a002fcc33b1d88ab9834 Mon Sep 17 00:00:00 2001 From: Guillaume Blaquiere Date: Mon, 27 Sep 2021 21:47:14 +0200 Subject: [PATCH] fix: wrong if condition, improve error message. --- google/google.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google/google.go b/google/google.go index c4fe932..a1f6671 100644 --- a/google/google.go +++ b/google/google.go @@ -184,8 +184,8 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar } return cfg.TokenSource(ctx) case impersonatedServiceAccount: - if f.ServiceAccountImpersonationURL != "" && f.SourceCredentials == nil { - return nil, errors.New("missing 'source_credentials' field in credentials") + if f.ServiceAccountImpersonationURL != "" || f.SourceCredentials == nil { + return nil, errors.New("missing 'source_credentials' field or 'service_account_impersonation_url' in credentials") } ts, err := f.SourceCredentials.tokenSource(ctx, params)