-
Notifications
You must be signed in to change notification settings - Fork 121
feat: Add support for PSC network connections #1347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's stick to v1beta4. Otherwise this looks great.
core/src/test/java/com/google/cloud/sql/core/SqlAdminApiFetcherTest.java
Outdated
Show resolved
Hide resolved
@@ -207,6 +207,11 @@ private Metadata fetchMetadata(CloudSqlInstanceName instanceName, AuthType authT | |||
ipAddrs.put(addr.getType(), addr.getIpAddress()); | |||
} | |||
|
|||
// resolve DnsName into IP address for PSC | |||
if (instanceMetadata.getDnsName() != null && !instanceMetadata.getDnsName().isEmpty()) { | |||
ipAddrs.put("PSC", instanceMetadata.getDnsName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Making "PSC" a constant would be nice.
This was successfully hand-tested. The java connector successfully connected to a PSC database when |
} | ||
|
||
@Test | ||
public void testFetchInstanceData_returnsPscForNonIpDatabase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new test for PSC databases that have no IP address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.