Skip to content

Commit dc95d31

Browse files
avovchenkoekrivokonmapr
authored andcommitted
[SPARK-301] Error while submitting job in Standalone cluster mode on MapR secure cluster (apache#334)
1 parent 315fd67 commit dc95d31

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

core/src/main/scala/org/apache/spark/SecurityManager.scala

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,11 @@ private[spark] class SecurityManager(
353353
return
354354
}
355355

356-
val master = sparkConf.get(SparkLauncher.SPARK_MASTER, "")
357-
master match {
358-
case "yarn" | "local" | LOCAL_N_REGEX(_) | LOCAL_N_FAILURES_REGEX(_, _) =>
359-
// Secret generation allowed here
360-
case _ =>
361-
require(sparkConf.contains(SPARK_AUTH_SECRET_CONF),
362-
s"A secret key must be specified via the $SPARK_AUTH_SECRET_CONF config.")
363-
return
356+
if (sparkConf.get(SparkLauncher.SPARK_MASTER, null) != "yarn") {
357+
require(sparkConf.contains(SPARK_AUTH_SECRET_CONF)
358+
|| sparkConf.getenv(ENV_AUTH_SECRET) != null,
359+
s"A secret key must be specified via the $SPARK_AUTH_SECRET_CONF config.")
360+
return
364361
}
365362

366363
secretKey = Utils.createSecret(sparkConf)

0 commit comments

Comments
 (0)