Skip to content

fix(transport): use ds.GetUniverseDomain() instead of raw ds.UniverseDomain field#3660

Open
yaroshevichg wants to merge 4 commits into
googleapis:mainfrom
yaroshevichg:main
Open

fix(transport): use ds.GetUniverseDomain() instead of raw ds.UniverseDomain field#3660
yaroshevichg wants to merge 4 commits into
googleapis:mainfrom
yaroshevichg:main

Conversation

@yaroshevichg

Copy link
Copy Markdown

Summary

Fixes an issue where GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable settings are ignored when dialing gRPC or HTTP transports unless option.WithUniverseDomain is explicitly passed in code.

Root Cause

DialSettings.GetUniverseDomain() resolves the effective universe domain by checking ds.UniverseDomain, falling back to GOOGLE_CLOUD_UNIVERSE_DOMAIN, and defaulting to "googleapis.com".

However, transport/grpc/dial.go and transport/http/dial.go populate UniverseDomain using the raw struct field ds.UniverseDomain. When a client relies on GOOGLE_CLOUD_UNIVERSE_DOMAIN from the environment without explicitly calling option.WithUniverseDomain(...), ds.UniverseDomain is empty (""), causing the transport layer to ignore the environment variable.

Solution

Use ds.GetUniverseDomain() when passing UniverseDomain in transport/grpc/dial.go and transport/http/dial.go.

@yaroshevichg yaroshevichg requested a review from a team as a code owner July 16, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant