> > Michele > > > > Sorry about that, I think I got confused the exec in code with the ability > > to uploading a string/executable file like a shell/bash script or perl > > script. > I know that if binary is false then it treats as a script and if it is > true as a zip file. > Problem is with Go actions an executable and a zip looks the same... > > > > > I think we can take a todo after implementing exec inside zip and add > > improvements. > > > > We should be able at the proxy level when binary=true (base64) distinguish > > the `code` by parsing the first bytes and tell if it's a zip, tgz, or > > executable related [1] > Great! It is exactly what I already implemented in the Go runtime. > > it is based on this library: https://github.com/h2non/filetype > > At the moment I am busy trying to make things robust and write unit tests...
Ok just committed the implementation that is able to distinguish a binary in elf format from a binary in zip format and handle it properly. Including unit tests :) Here is the code: https://github.com/sciabarracom/openwhisk-runtime-go/blob/pipe-loop/openwhisk/extractor.go https://github.com/sciabarracom/openwhisk-runtime-go/blob/pipe-loop/openwhisk/extractor_test.go