spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vanzin <...@git.apache.org>
Subject [GitHub] spark pull request #19437: [SPARK-22131][MESOS] Mesos driver secrets
Date Wed, 25 Oct 2017 21:28:12 GMT
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19437#discussion_r146991758
  
    --- Diff: resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackendUtil.scala
---
    @@ -173,6 +177,88 @@ private[mesos] object MesosSchedulerBackendUtil extends Logging {
         containerInfo
       }
     
    +  private def getSecrets(conf: SparkConf, secretConfig: MesosSecretConfig): Seq[Secret]
= {
    +    def createValueSecret(data: String): Secret = {
    +      Secret.newBuilder()
    +        .setType(Secret.Type.VALUE)
    +        .setValue(Secret.Value.newBuilder().setData(ByteString.copyFrom(data.getBytes)))
    +        .build()
    +    }
    +
    +    def createReferenceSecret(name: String): Secret = {
    +      Secret.newBuilder()
    +        .setReference(Secret.Reference.newBuilder().setName(name))
    +        .setType(Secret.Type.REFERENCE)
    +        .build()
    +    }
    +
    +    val referenceSecrets: Seq[Secret] =
    +      conf.get(secretConfig.SECRET_NAMES).getOrElse(Nil).map(s => createReferenceSecret(s))
    --- End diff --
    
    nit (also in other places): `.map { s => ... }`


---

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


Mime
View raw message