From 9d585498a5a4aeb2b28b5a574db6771d77427a9b Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 21 Mar 2024 13:29:04 -0600 Subject: [PATCH] fix(transport): return GDU for all errors from MDS universe_domain refs: #2399 --- internal/settings.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/settings.go b/internal/settings.go index 6b709da707e..af4a038d3e2 100644 --- a/internal/settings.go +++ b/internal/settings.go @@ -195,7 +195,7 @@ func (ds *DialSettings) IsUniverseDomainGDU() bool { // GetUniverseDomain returns the default service domain for a given Cloud // universe, from google.Credentials, for comparison with the value returned by // (*DialSettings).GetUniverseDomain. This wrapper function should be removed -// to close [TODO(chrisdsmith): issue link here]. See details below. +// to close https://github.com/googleapis/google-api-go-client/issues/2399. func GetUniverseDomain(creds *google.Credentials) (string, error) { timer := time.NewTimer(time.Second) defer timer.Stop() @@ -212,9 +212,10 @@ func GetUniverseDomain(creds *google.Credentials) (string, error) { }() select { - case err := <-errors: - // An error that is returned before the timer expires is legitimate. - return "", err + case <-errors: + // An error that is returned before the timer expires is likely to be + // connection refused. Temporarily (2024-03-21) return the GDU domain. + return universeDomainDefault, nil case res := <-results: return res, nil case <-timer.C: // Timer is expired.