pan3793 commented on code in PR #5015:
URL: https://github.com/apache/kyuubi/pull/5015#discussion_r1263449614
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/service/TFrontendService.scala:
##########
@@ -112,12 +112,17 @@ abstract class TFrontendService(name: String)
override def connectionUrl: String = {
checkInitialized()
- val host = serverHost match {
- case Some(h) => h // respect user's setting ahead
- case None if conf.get(FRONTEND_CONNECTION_URL_USE_HOSTNAME) =>
- serverAddr.getCanonicalHostName
- case None =>
- serverAddr.getHostAddress
+ val advertisedHost = conf.get(FRONTEND_ADVERTISED_HOST)
+ val host = if (advertisedHost.isEmpty) {
+ serverHost match {
+ case Some(h) => h // respect user's setting ahead
+ case None if conf.get(FRONTEND_CONNECTION_URL_USE_HOSTNAME) =>
+ serverAddr.getCanonicalHostName
+ case None =>
+ serverAddr.getHostAddress
+ }
+ } else {
+ advertisedHost.get
}
Review Comment:
```suggestion
(conf.get(FRONTEND_ADVERTISED_HOST), serverHost) match {
case (Some(advertisedHost), _) => advertisedHost
case (None, Some(h)) => h
case (None, None) if conf.get(FRONTEND_CONNECTION_URL_USE_HOSTNAME) =>
serverAddr.getCanonicalHostName
case (None, None) => serverAddr.getHostAddress
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]