Skip to content

Commit

Permalink
GCP: handle failed project auto detection
Browse files Browse the repository at this point in the history
  • Loading branch information
alebedev87 committed Oct 18, 2021
1 parent d9f1310 commit d5eb1bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions provider/google/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ func NewGoogleProvider(ctx context.Context, project string, domainFilter endpoin

if project == "" {
mProject, mErr := metadata.ProjectID()
if mErr == nil {
log.Infof("Google project auto-detected: %s", mProject)
project = mProject
if mErr != nil {
return nil, fmt.Errorf("failed to auto-detect the project id: %w", mErr)
}
log.Infof("Google project auto-detected: %s", mProject)
project = mProject
}

zoneTypeFilter := provider.NewZoneTypeFilter(zoneVisibility)
Expand Down

0 comments on commit d5eb1bf

Please sign in to comment.