File tree Expand file tree Collapse file tree 1 file changed +19
-14
lines changed
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s Expand file tree Collapse file tree 1 file changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -116,20 +116,25 @@ private[spark] object KubernetesConf {
116
116
}
117
117
}
118
118
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
+ }
133
138
134
139
val driverCustomLabels = KubernetesUtils .parsePrefixedKeyValuePairs(
135
140
sparkConf, KUBERNETES_DRIVER_LABEL_PREFIX )
You can’t perform that action at this time.
0 commit comments