Skip to content

Commit

Permalink
Add better error messages for gcp preflights (#425)
Browse files Browse the repository at this point in the history
We send the same message for each of these, which is actually not that helpful.
  • Loading branch information
michaeljguarino authored Aug 8, 2023
1 parent 82501ec commit 2677a9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/provider/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func (gcp *GCPProvider) validateEnabled() error {
proj, err := gcp.getProject()
if err != nil {
utils.LogError().Println(err)
return errEnabled
return fmt.Errorf("Could not find gcp project %s. Was your authentication misconfigured?", gcp.Proj)
}

services := algorithms.Map([]string{
Expand All @@ -377,7 +377,7 @@ func (gcp *GCPProvider) validateEnabled() error {
resp, err := c.BatchGetServices(ctx, req)
if err != nil {
utils.LogError().Println(err)
return errEnabled
return fmt.Errorf("Could not fetch services information for project %s, does your service account have appropriate permissions?", gcp.Proj)
}

missing := algorithms.Filter(resp.Services, func(svc *serviceusagepb.Service) bool {
Expand Down

0 comments on commit 2677a9f

Please sign in to comment.