Closed john98nf closed 3 years ago
Solution found by studying openwhisk-cli action create command implementation itself. Code field requires to point to a string containing the action-code. So something like:
file, err := ioutil.ReadFile("/path/to/sourceCode.go")
if err != nil {
log.Fatal(err)
}
code := string(file)
newAction.Exec.Code = &code
, should do the trick.
Hello,
I'm trying to deploy an action with go runtime by using this go client. I found the Insert method, so I'm trying something like:
The problem is that I can't figure out how to specify the source code for this function. Is it possible to assing a certain path to a field of one of these two types like
newAction.Exec.sth = "/path/to/foo.go"
?? Also, when i try for example settingnewAction.Exec.Image = "/path/to/exec.zip"
(where zip created following this guide) and ignoringCode
field, i'm getting a 400 Bad Request with the following error:So, i'm pretty sure that I'm not using it right 😝. Does anyone have any thoughts on this?
Best regards