Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r215450600
  
    --- Diff: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala
 ---
    @@ -59,5 +66,28 @@ private[spark] object KubernetesUtils {
         }
       }
     
    +  def loadPodFromTemplate(
    +      kubernetesClient: KubernetesClient,
    +      templateFile: File): SparkPod = {
    +    try {
    +      val pod = kubernetesClient.pods().load(templateFile).get()
    +      pod.getSpec.getContainers.asScala.toList match {
    --- End diff --
    
    I think you can use `headOption` here to get an `Option` object and use 
`map`, `getOrElse`.


---

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

Reply via email to