feat: Add PSC DNS and Global Write Endpoint support to Python Connector#1424
Merged
Conversation
hessjcg
force-pushed
the
psc-dns-support
branch
2 times, most recently
from
July 15, 2026 19:10
70138b1 to
583323a
Compare
hessjcg
marked this pull request as ready for review
July 15, 2026 19:55
panavenue
approved these changes
Jul 21, 2026
hessjcg
force-pushed
the
psc-dns-support
branch
2 times, most recently
from
July 23, 2026 19:21
f265351 to
f42df6b
Compare
…with Go - Reject 'global' region in direct PSC DNS resolution in DnsResolver to force CNAME/TXT fallback. - Remove fallback to Private/Public IP in Connector when DNS fails and preferred IP is a hostname. - Update test_connector.py to assert no fallback from PSC to Private IP when DNS fails. - Add test_resolver.py test to verify global region skips direct resolution.
hessjcg
enabled auto-merge (squash)
July 23, 2026 22:35
- Add __init__ to DefaultResolver and DnsResolver to accept client in constructor. - Remove set_client method from DnsResolver. - Lazy-initialize self._resolver in Connector.connect_async passing the initialized self._client. - Update tests to use constructor injection instead of set_client. - Fix lint (ruff) and type checking (mypy) errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Private Service Connect (PSC) DNS Name Resolution & Fallback feature enables the connector to securely connect to Cloud SQL database instances using Private Service Connect (PSC) DNS and custom domain names (CNAMEs).
The connector can now dial PSC instances using its DNS hostname (e.g., 0123456789ab.fedcba9876543.us-central1.sql-psc.goog) or a custom domain CNAME pointing to the instance PSC DNS hostname. The connectors will dynamically resolve this hostname to its real Cloud SQL instance connection name via the SQL Admin API. Furthermore, if local DNS resolution of this hostname fails (e.g., on local developer networks lacking a private DNS route), the connectors gracefully fall back to dialing the instance's Private or Public IP address dynamically retrieved from metadata.
See also: GoogleCloudPlatform/cloud-sql-go-connector#1106