Skip to content

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

Merged
merged 8 commits into from
Jul 11, 2023
Merged

feat: Add support for PSC network connections #1347

merged 8 commits into from
Jul 11, 2023

Conversation

hessjcg
Copy link
Collaborator

@hessjcg hessjcg commented Jul 6, 2023

No description provided.

@hessjcg hessjcg requested a review from a team as a code owner July 6, 2023 18:11
Copy link
Member

@enocom enocom left a 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.

@@ -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());
Copy link
Member

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.

@hessjcg
Copy link
Collaborator Author

hessjcg commented Jul 11, 2023

This was successfully hand-tested. The java connector successfully connected to a PSC database when ipTypes=PSC was set.

}

@Test
public void testFetchInstanceData_returnsPscForNonIpDatabase()
Copy link
Collaborator Author

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

Copy link
Collaborator

@jackwotherspoon jackwotherspoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hessjcg hessjcg merged commit 4474f16 into main Jul 11, 2023
@hessjcg hessjcg deleted the gh-1346-psc branch July 11, 2023 20:44
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.

3 participants