You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/14 15:38:01 UTC

[GitHub] dubeejw commented on a change in pull request #2847: Treat action code as attachments for created/updated actions

dubeejw commented on a change in pull request #2847: Treat action code as attachments for created/updated actions
URL: https://github.com/apache/incubator-openwhisk/pull/2847#discussion_r168212354
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/entity/Exec.scala
 ##########
 @@ -122,19 +124,24 @@ protected[core] case class CodeExecMetaDataAsString(manifest: RuntimeManifest) e
 
 protected[core] case class CodeExecAsAttachment(manifest: RuntimeManifest,
                                                 override val code: Attachment[String],
-                                                override val entryPoint: Option[String])
+                                                override val entryPoint: Option[String],
+                                                override val binary: Boolean = false)
     extends CodeExec[Attachment[String]] {
   override val kind = manifest.kind
   override val image = manifest.image
   override val sentinelledLogs = manifest.sentinelledLogs.getOrElse(true)
   override val deprecated = manifest.deprecated.getOrElse(false)
   override val pull = false
-  override lazy val binary = true
   override def codeAsJson = code.toJson
 
   def inline(bytes: Array[Byte]): CodeExecAsAttachment = {
-    val encoded = new String(bytes, StandardCharsets.UTF_8)
-    copy(code = Inline(encoded))
+    val code = new String(bytes, StandardCharsets.UTF_8)
+
+    if (kind == "java" && !Exec.isBinaryCode(code)) {
 
 Review comment:
   Allows backward compatibility with old Java actions that have attachments that are not base64.

----------------------------------------------------------------
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