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

    https://github.com/apache/spark/pull/20167#discussion_r167321443
  
    --- Diff: 
resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerUtils.scala
 ---
    @@ -106,6 +99,40 @@ trait MesosSchedulerUtils extends Logging {
         }
       }
     
    +  def buildCredentials(
    +      conf: SparkConf,
    +      fwInfoBuilder: Protos.FrameworkInfo.Builder): 
Protos.Credential.Builder = {
    +    val credBuilder = Credential.newBuilder()
    +    conf.getOption("spark.mesos.principal")
    +      .orElse(Option(conf.getenv("SPARK_MESOS_PRINCIPAL")))
    +      .orElse(
    +        conf.getOption("spark.mesos.principal.file")
    +          .orElse(Option(conf.getenv("SPARK_MESOS_PRINCIPAL_FILE")))
    +          .map { principalFile =>
    +            Files.toString(new File(principalFile), StandardCharsets.UTF_8)
    +          }
    +      ).foreach { principal =>
    +          fwInfoBuilder.setPrincipal(principal)
    --- End diff --
    
    nit: this block is indented 4 spaces not 2.


---

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

Reply via email to