You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by "dgrove-oss (via GitHub)" <gi...@apache.org> on 2023/04/03 18:50:52 UTC

[GitHub] [openwhisk-runtime-go] dgrove-oss commented on a diff in pull request #191: Add tar.gz support to the go Proxy

dgrove-oss commented on code in PR #191:
URL: https://github.com/apache/openwhisk-runtime-go/pull/191#discussion_r1156338226


##########
openwhisk/filetype.go:
##########
@@ -65,3 +65,13 @@ func IsZip(buf []byte) bool {
 		(buf[2] == 0x3 || buf[2] == 0x5 || buf[2] == 0x7) &&
 		(buf[3] == 0x4 || buf[3] == 0x6 || buf[3] == 0x8)
 }
+
+// IsTarGz checks if the given file is a valid tar.gz file
+func IsTarGz(buf []byte) bool {

Review Comment:
   I think this is only checking for a gzip file.  Is there a check for tar format too?  or should the name of the function be changed to`isGz` 



##########
openwhisk/extractor.go:
##########
@@ -64,6 +64,17 @@ func (ap *ActionProxy) ExtractAction(buf *[]byte, suffix string) (string, error)
 		}
 		Debug("Extract Action, assuming a zip")
 		return file, Unzip(*buf, newDir)
+
+	} else if IsTarGz(*buf) {
+		jar := os.Getenv("OW_SAVE_JAR")
+		if jar != "" {
+			jarFile := newDir + "/" + jar
+			Debug("Extract Action, checking if it is a jar first")
+			return jarFile, UnzipOrSaveJar(*buf, newDir, jarFile)
+		}
+
+		Debug("Extract Action, assuming a zip")

Review Comment:
   ```suggestion
   		Debug("Extract Action, assuming a tar.gz")
   ```



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

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org