Skip to content
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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ trait KerberizedTestHelper extends KyuubiFunSuite {
if (s.contains("libdefaults")) {
rewritten = true
s + addedConfig
} else if (s.contains(hostName)) {
s + "\n" + s.replace(hostName, s"tcp/$hostName")
turboFei marked this conversation as resolved.
Show resolved Hide resolved
} else {
s
}).filter(!_.trim.startsWith("#")).mkString(System.lineSeparator())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Copy link
Member

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?

.orElse(Option(System.getenv("KRB5_CONFIG")))
Copy link
Member

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?

.getOrElse("/etc/krb5.conf")
val commands = Seq("kinit", "-kt", keytab.get, principal.get)
val kinitProc = new ProcessBuilder(commands: _*).inheritIO()
kinitProc.environment().put("KRB5_CONFIG", krb5Conf)
kinitTask = new Runnable {
override def run(): Unit = {
val process = kinitProc.start()
Expand Down