You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/05 09:39:26 UTC

[GitHub] [spark] jaceklaskowski commented on a change in pull request #30472: [SPARK-32221][k8s] Avoid possible errors due to incorrect file size or type supplied in spark conf.

jaceklaskowski commented on a change in pull request #30472:
URL: https://github.com/apache/spark/pull/30472#discussion_r551818647



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtils.scala
##########
@@ -156,11 +162,8 @@ private[spark] object KubernetesClientUtils extends Logging {
     }
     val confFiles: Seq[File] = {
       val dir = new File(confDir)
-      if (dir.isDirectory) {
-        dir.listFiles.filter(x => fileFilter(x)).toSeq
-      } else {
-        Nil
-      }
+      assert(dir.isDirectory, "Spark conf should be a directory.")

Review comment:
       nit: move this assertion up so it's caught early (at least around line 135). I also think it should be `IllegalArgumentException` instead.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org