Skip to content

Commit 9018800

Browse files
author
Robert Kruszewski
committed
fix settings
1 parent dc0b466 commit 9018800

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesConf.scala

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,25 @@ private[spark] object KubernetesConf {
116116
}
117117
}
118118

119-
sparkConfWithMainAppJar.setJars(
120-
sparkConfWithMainAppJar.getOption("spark.jars")
121-
.map(_.split(","))
122-
.getOrElse(Array.empty)
123-
.map(_.trim)
124-
.filterNot(_.isEmpty))
125-
126-
sparkConfWithMainAppJar.set("spark.files",
127-
sparkConfWithMainAppJar.getOption("spark.files")
128-
.map(_.split(","))
129-
.getOrElse(Array.empty)
130-
.map(_.trim)
131-
.filterNot(_.isEmpty)
132-
.mkString(","))
119+
val trimmedJars = sparkConfWithMainAppJar.getOption("spark.jars")
120+
.map(_.split(","))
121+
.getOrElse(Array.empty)
122+
.map(_.trim)
123+
.filterNot(_.isEmpty)
124+
125+
if (trimmedJars.nonEmpty) {
126+
sparkConfWithMainAppJar.setJars(trimmedJars)
127+
}
128+
129+
val trimmedFiles = sparkConfWithMainAppJar.getOption("spark.files")
130+
.map(_.split(","))
131+
.getOrElse(Array.empty)
132+
.map(_.trim)
133+
.filterNot(_.isEmpty)
134+
135+
if (trimmedFiles.nonEmpty) {
136+
sparkConfWithMainAppJar.set("spark.files", trimmedFiles.mkString(","))
137+
}
133138

134139
val driverCustomLabels = KubernetesUtils.parsePrefixedKeyValuePairs(
135140
sparkConf, KUBERNETES_DRIVER_LABEL_PREFIX)

0 commit comments

Comments
 (0)