File tree Expand file tree Collapse file tree
core/src/main/scala/org/apache/spark Expand file tree Collapse file tree Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments