Skip to content

Commit

Permalink
chore: strip trailing period from DNS
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Sep 5, 2024
1 parent 43846b9 commit ac2abee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions google/cloud/sql/connector/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ async def _get_metadata(
# resolve dnsName into IP address for PSC
# Note that we have to check for PSC enablement also because CAS
# instances also set the dnsName field.
dns_name = ret_dict.get("dnsName", "")
# Remove trailing period from DNS name. Required for SSL in Python
dns_name = ret_dict.get("dnsName", "").rstrip(".")
if dns_name and ret_dict.get("pscEnabled"):
# Remove trailing period from PSC DNS name. Required for SSL in Python
ip_addresses["PSC"] = dns_name.rstrip(".")
ip_addresses["PSC"] = dns_name

return {
"ip_addresses": ip_addresses,
Expand Down

0 comments on commit ac2abee

Please sign in to comment.