dgrove-oss commented on a change in pull request #4570: KCF: propagate 
cf_ca_extraArgs_env_i into user containers
URL: 
https://github.com/apache/incubator-openwhisk/pull/4570#discussion_r307853035
 
 

 ##########
 File path: 
common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerFactory.scala
 ##########
 @@ -30,7 +30,18 @@ case class ContainerArgsConfig(network: String,
                                dnsServers: Seq[String] = Seq.empty,
                                dnsSearch: Seq[String] = Seq.empty,
                                dnsOptions: Seq[String] = Seq.empty,
-                               extraArgs: Map[String, Set[String]] = Map.empty)
+                               extraEnvVars: Seq[String] = Seq.empty,
+                               extraArgs: Map[String, Set[String]] = 
Map.empty) {
+
+  val extraEnvVarMap: Map[String, String] =
+    extraEnvVars.flatMap {
+      _.split("=", 2) match {
+        case Array(key)        => Some(key -> "")
+        case Array(key, value) => Some(key -> value)
+        case _                 => None
 
 Review comment:
   I think the _ case is unreachable and maybe we don't need the Option type 
now since a failure to split on `=` can be interpreted as a request to simply 
set an envvar with an empty value.  But I don't think it hurts to do it this 
way. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

Reply via email to