dongjoon-hyun commented on code in PR #35886:
URL: https://github.com/apache/spark/pull/35886#discussion_r949707868
##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala:
##########
@@ -122,68 +122,41 @@ private[spark] class BasicExecutorFeatureStep(
buildExecutorResourcesQuantities(execResources.customResources.values.toSet)
val executorEnv: Seq[EnvVar] = {
- (Seq(
- (ENV_DRIVER_URL, driverUrl),
- (ENV_EXECUTOR_CORES, execResources.cores.get.toString),
- (ENV_EXECUTOR_MEMORY, executorMemoryString),
- (ENV_APPLICATION_ID, kubernetesConf.appId),
- // This is to set the SPARK_CONF_DIR to be /opt/spark/conf
- (ENV_SPARK_CONF_DIR, SPARK_CONF_DIR_INTERNAL),
- (ENV_EXECUTOR_ID, kubernetesConf.executorId),
- (ENV_RESOURCE_PROFILE_ID, resourceProfile.id.toString)
- ) ++ kubernetesConf.environment).map { case (k, v) =>
- new EnvVarBuilder()
- .withName(k)
- .withValue(v)
- .build()
- }
- } ++ {
- Seq(new EnvVarBuilder()
- .withName(ENV_EXECUTOR_POD_IP)
- .withValueFrom(new EnvVarSourceBuilder()
- .withNewFieldRef("v1", "status.podIP")
- .build())
- .build())
- } ++ {
- Seq(new EnvVarBuilder()
- .withName(ENV_EXECUTOR_POD_NAME)
- .withValueFrom(new EnvVarSourceBuilder()
- .withNewFieldRef("v1", "metadata.name")
- .build())
- .build())
- } ++ {
- if (kubernetesConf.get(AUTH_SECRET_FILE_EXECUTOR).isEmpty) {
- Option(secMgr.getSecretKey()).map { authSecret =>
- new EnvVarBuilder()
- .withName(SecurityManager.ENV_AUTH_SECRET)
- .withValue(authSecret)
- .build()
- }
- } else None
- } ++ {
- kubernetesConf.get(EXECUTOR_CLASS_PATH).map { cp =>
- new EnvVarBuilder()
- .withName(ENV_CLASSPATH)
- .withValue(cp)
- .build()
- }
- } ++ {
- val userOpts = kubernetesConf.get(EXECUTOR_JAVA_OPTIONS).toSeq.flatMap
{ opts =>
- val subsOpts = Utils.substituteAppNExecIds(opts,
kubernetesConf.appId,
- kubernetesConf.executorId)
+ val sparkAuthSecret = if
(kubernetesConf.get(AUTH_SECRET_FILE_EXECUTOR).isEmpty) {
+ Map(SecurityManager.ENV_AUTH_SECRET -> secMgr.getSecretKey())
+ } else {
+ Nil
+ }
Review Comment:
To be consistent, we need to skip `Map` creation when
`secMgr.getSecretKey()` is null too.
https://github.com/apache/spark/blob/5bffb983f8f9482660701cc34e7cc23771961888/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala#L156-L161
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]