[KYUUBI #3686] The authentication.kerberos.principal value posted to zk should keep the original value

### _Why are the changes needed?_

close #3686

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #3961 from QianyongY/features/kyuubi-3686.

Closes #3686

958432c6 [yongqian] [KYUUBI #3686] The  value posted to zk should keep the original value

Authored-by: yongqian <yongqian@trip.com>
Signed-off-by: Shaoyun Chen <csy@apache.org>
This commit is contained in:
yongqian 2022-12-12 11:30:33 +08:00 committed by Shaoyun Chen
parent 46ffc7b603
commit 4948056640
No known key found for this signature in database
GPG Key ID: 81A87B8D54DB73A3

View File

@ -57,7 +57,6 @@ import org.apache.kyuubi.ha.client.ServiceNodeInfo
import org.apache.kyuubi.ha.client.zookeeper.ZookeeperClientProvider.buildZookeeperClient
import org.apache.kyuubi.ha.client.zookeeper.ZookeeperClientProvider.getGracefulStopThreadDelay
import org.apache.kyuubi.ha.client.zookeeper.ZookeeperDiscoveryClient.connectionChecker
import org.apache.kyuubi.util.KyuubiHadoopUtils
import org.apache.kyuubi.util.ThreadUtils
class ZookeeperDiscoveryClient(conf: KyuubiConf) extends DiscoveryClient {
@ -338,8 +337,7 @@ class ZookeeperDiscoveryClient(conf: KyuubiConf) extends DiscoveryClient {
confsToPublish += ("hive.server2.authentication" -> authenticationMethod)
if (authenticationMethod.equalsIgnoreCase("KERBEROS")) {
confsToPublish += ("hive.server2.authentication.kerberos.principal" ->
conf.get(KyuubiConf.SERVER_PRINCIPAL).map(KyuubiHadoopUtils.getServerPrincipal)
.getOrElse(""))
conf.get(KyuubiConf.SERVER_PRINCIPAL).getOrElse(""))
}
confsToPublish.map { case (k, v) => k + "=" + v }.mkString(";")
}