Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#2387 from alebedev87/gcp-project-a…
Browse files Browse the repository at this point in the history
…utodetect-fail

GCP: handle failed project auto detection
  • Loading branch information
k8s-ci-robot authored Oct 20, 2021
2 parents 3756f60 + d5eb1bf commit 073d9d5
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 073d9d5

Please sign in to comment.