-
Notifications
You must be signed in to change notification settings - Fork 119
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
chore: Add domain name to the connector config. #2098
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.
This LGTM but let's also get someone more experienced at Java to review it as well
This comment was marked as resolved.
This comment was marked as resolved.
cf8fc9d
to
0bd57d4
Compare
this.connectionName = connectionName; | ||
this.domainName = domainName; |
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.
Do we want to validate it with some DOMAIN_NAME matcher ? generic DNS name or something ?
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.
Done. I added a Regex to validate the domain name.
@@ -154,6 +157,37 @@ ConnectionInfoCache getConnection(ConnectionConfig config) { | |||
return instance; | |||
} | |||
|
|||
private ConnectionConfig resolveConnectionName(ConnectionConfig config) { |
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.
I know its private method (so method documentation is optional) but I think this method is important enough that it requires some explanation. Like cloudSqlInstance is prioritized over domainName when both are set etc.
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.
Done.
@@ -131,6 +131,50 @@ public void create_successfulPrivateConnection() throws IOException, Interrupted | |||
assertThat(readLine(socket)).isEqualTo(SERVER_MESSAGE); | |||
} | |||
|
|||
@Test | |||
public void create_successfulPublicConnectionWithDomainName() |
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.
Can we have a test for both domainName and cloudSqlInstance set?
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.
Done.
2685a44
to
14f7483
Compare
See #2043 for the whole feature definition.
14f7483
to
9536668
Compare
Add DomainName to connection config, and an InstanceNameResolver function. This will allow the connector
to be configured using a domain name referencing the instead of the instance name.
This is part of the implementation of #2043.
See #2043 for the whole feature definition.