[v11.3.x] GCM: Fix error checking for GCE project getter (#95617)
GCM: Fix error checking for GCE project getter (#95613)
Appropriately check error
(cherry picked from commit 08e880a823)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
This commit is contained in:
co-authored by
Andreas Christou
parent
1540c767cc
commit
fdc1859d0d
@@ -591,7 +591,10 @@ func (s *Service) ensureProject(ctx context.Context, dsInfo datasourceInfo, proj
|
||||
func (s *Service) getDefaultProject(ctx context.Context, dsInfo datasourceInfo) (string, error) {
|
||||
if dsInfo.authenticationType == gceAuthentication {
|
||||
project, err := s.gceDefaultProjectGetter(ctx, cloudMonitorScope)
|
||||
return project, errorsource.DownstreamError(err, false)
|
||||
if err != nil {
|
||||
return project, errorsource.DownstreamError(err, false)
|
||||
}
|
||||
return project, nil
|
||||
}
|
||||
return dsInfo.defaultProject, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user