markusthoemmes commented on a change in pull request #3945: Treat action code 
as attachments
URL: 
https://github.com/apache/incubator-openwhisk/pull/3945#discussion_r208153927
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/entity/Exec.scala
 ##########
 @@ -302,21 +309,29 @@ protected[core] object Exec extends ArgNormalizer[Exec] 
with DefaultJsonProtocol
 
           manifest.attached
             .map { a =>
-              val jar: Attachment[String] = {
-                // java actions once stored the attachment in "jar" instead of 
"code"
-                obj.fields.get("code").orElse(obj.fields.get("jar"))
+              val code = obj.fields.get("code")
+              val binary: Boolean = code match {
+                case Some(JsString(c)) => isBinaryCode(c)
+                case _ =>
+                  obj.fields.get("binary") match {
+                    case Some(JsBoolean(b)) => b
+                    case _                  => false
+                  }
+              }
+              val attachment: Attachment[String] = {
+                code
 
 Review comment:
   Chatted with @chetanmeh, I was indeed missing something:
   
   `code` can be a JsObject, that breaks my simplification of course.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to