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

    https://github.com/apache/spark/pull/22904#discussion_r239272037
  
    --- Diff: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkKubernetesClientFactory.scala
 ---
    @@ -67,8 +66,16 @@ private[spark] object SparkKubernetesClientFactory {
         val dispatcher = new Dispatcher(
           ThreadUtils.newDaemonCachedThreadPool("kubernetes-dispatcher"))
     
    -    // TODO [SPARK-25887] Create builder in a way that respects 
configurable context
    -    val config = new ConfigBuilder()
    +    // Allow for specifying a context used to auto-configure from the 
users K8S config file
    +    val kubeContext = sparkConf.get(KUBERNETES_CONTEXT).filter(_.nonEmpty)
    +    logInfo(s"Auto-configuring K8S client using " +
    +      s"${if (kubeContext.isDefined) s"context 
${kubeContext.getOrElse("?")}" else "current context"}" +
    --- End diff --
    
    I think using `kubeContext.map("context " + _).getOrElse("current 
context")` would make this cleaner.


---

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

Reply via email to