You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by gi...@git.apache.org on 2017/05/14 13:16:06 UTC

[GitHub] markusthoemmes commented on a change in pull request #2232: make dns server configurable for user containers

markusthoemmes commented on a change in pull request #2232: make dns server configurable for user containers
URL: https://github.com/apache/incubator-openwhisk/pull/2232#discussion_r116380703
 
 

 ##########
 File path: core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainer.scala
 ##########
 @@ -73,6 +75,8 @@ object DockerContainer {
             case (key, value) => Seq("-e", s"$key=$value")
         }.flatten
 
+        val dnsArgs = dnsServer.foldLeft(Array.empty[String]) { (a,d) => a ++ Array("--dns", d) }
 
 Review comment:
   Should be equivalent to:
   
   ```scala
   dnsServers.map(Seq("--dns", _)).flatten
   ```
   
   (I'd always prefer the more abstract `map` over a relatively lowlevel `foldLeft`).
   
   Also note that `Array` is a mutable/indexed datastructure, thus it's usage should be chosen carefully.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services