-
Notifications
You must be signed in to change notification settings - Fork 919
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
[TEST] Transfer KRB5_CONF to kinit and fix kerberos UT on macOS #1291
Conversation
kyuubi-common/src/test/scala/org/apache/kyuubi/KerberizedTestHelper.scala
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #1291 +/- ##
=========================================
Coverage 78.27% 78.27%
Complexity 110 110
=========================================
Files 177 177
Lines 7103 7108 +5
Branches 874 874
=========================================
+ Hits 5560 5564 +4
- Misses 1063 1064 +1
Partials 480 480
Continue to review full report at Codecov.
|
kyuubi-server/src/main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala
Outdated
Show resolved
Hide resolved
@@ -45,7 +45,8 @@ class KinitAuxiliaryService() extends AbstractService("KinitAuxiliaryService") { | |||
|
|||
require(keytab.nonEmpty && principal.nonEmpty, "principal or keytab is missing") | |||
UserGroupInformation.loginUserFromKeytab(principal.get, keytab.get) | |||
val commands = Seq("kinit", "-kt", keytab.get, principal.get) | |||
val krb5Conf = System.getProperty("java.security.krb5.conf") | |||
val commands = Seq(s"env KRB5_CONFIG=$krb5Conf", "kinit", "-kt", keytab.get, principal.get) |
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.
for the commands executed in processBuilder, its default KRB5_CONFIG is not same with the value of java.security.krb5.conf
of KyuubiServer JVM.
Thanks, merging to master |
@@ -45,8 +45,12 @@ class KinitAuxiliaryService() extends AbstractService("KinitAuxiliaryService") { | |||
|
|||
require(keytab.nonEmpty && principal.nonEmpty, "principal or keytab is missing") | |||
UserGroupInformation.loginUserFromKeytab(principal.get, keytab.get) | |||
val krb5Conf = Option(System.getProperty("java.security.krb5.conf")) |
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.
Shall we get it from KyuubiConf?
@@ -45,8 +45,12 @@ class KinitAuxiliaryService() extends AbstractService("KinitAuxiliaryService") { | |||
|
|||
require(keytab.nonEmpty && principal.nonEmpty, "principal or keytab is missing") | |||
UserGroupInformation.loginUserFromKeytab(principal.get, keytab.get) | |||
val krb5Conf = Option(System.getProperty("java.security.krb5.conf")) | |||
.orElse(Option(System.getenv("KRB5_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.
Shall we add KRB5_CONFIG to kyuubi-env.sh.template?
Why are the changes needed?
java.security.krb5.conf
of KyuubiServer JVM.KyuubiOperationKerberosAndPlainAuthSuite
([KYUUBI #1262] Support both KERBEROS and PLAIN authentication at the same time #1266). For the root cause, see details in https://stackoverflow.com/questions/27053539/openldap-kerberos-unable-to-reach-any-kdc-in-realmHow was this patch tested?
KyuubiOperationKerberosAndPlainAuthSuite
can pass on my MacBook, without this PR, it will fail on MacBook.