rabbah commented on a change in pull request #4559: Allow parameters to be
designated as init time properties
URL: https://github.com/apache/openwhisk/pull/4559#discussion_r317124971
##########
File path:
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
##########
@@ -770,6 +770,31 @@ object ContainerProxy {
causedBy ++ initTime ++ binding
})
}
+
+ /**
+ * Partitions the activation arguments into two JsObject instances. The
first is exported as intended for export
+ * by the action runtime to the environment. The second is passed on as
arguments to the action.
+ *
+ * @param content the activation arguments
+ * @param initArgs set of parameters to treat as initialization arguments
+ * @return A partition of the arguments into an environment variables map
and the JsObject argument to the action
+ */
+ def partitionArguments(content: Option[JsObject], initArgs: Set[String]):
(Map[String, JsString], JsObject) = {
+ content match {
+ case None => (Map.empty, JsObject.empty)
+ case Some(js) if initArgs.isEmpty => (Map.empty, js)
+ case Some(js) =>
+ val (env, args) = js.fields.partition(k => initArgs.contains(k._1))
+
+ (env.map {
Review comment:
https://github.com/apache/openwhisk/pull/4559/commits/1fb74dcccd834846975eaf68883875853d03b834
relocates the conversion to the initializer.
----------------------------------------------------------------
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