fix: add ImpersonationURL check

This commit is contained in:
Guillaume Blaquiere
2021-09-15 10:16:09 +02:00
parent 1c896197e8
commit 2a8fe80698

View File

@@ -184,7 +184,7 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar
}
return cfg.TokenSource(ctx)
case impersonatedServiceAccount:
if f.SourceCredentials == nil {
if f.ServiceAccountImpersonationURL != "" && f.SourceCredentials == nil {
return nil, errors.New("missing 'source_credentials' field in credentials")
}