markusthoemmes commented on a change in pull request #2659: Containerfactory SPI
URL:
https://github.com/apache/incubator-openwhisk/pull/2659#discussion_r139072972
##########
File path:
core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainer.scala
##########
@@ -66,27 +59,25 @@ object DockerContainer {
environment: Map[String, String] = Map(),
network: String = "bridge",
dnsServers: Seq[String] = Seq(),
- name: Option[String] = None)(implicit docker:
DockerApiWithFileAccess,
- runc: RuncApi,
- ec: ExecutionContext,
- log: Logging):
Future[DockerContainer] = {
+ name: Option[String] = None,
+ dockerRunParameters: MultiMap[String, String])(implicit docker:
DockerApiWithFileAccess,
+ runc: RuncApi,
+ ec:
ExecutionContext,
+ log: Logging):
Future[DockerContainer] = {
implicit val tid = transid
- val environmentArgs = environment.map {
+ val environmentArgs = environment.flatMap {
case (key, value) => Seq("-e", s"$key=$value")
- }.flatten
+ }
- val dnsArgs = dnsServers.map(Seq("--dns", _)).flatten
+ val params = dockerRunParameters.flatMap {
+ case (key, valueList) =>
+ valueList.map {
Review comment:
Could be `flatMap` to not iterate again.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services