apache / openwhisk-workshop

[DEPRECATED] - OpenWhisk workshop to help developers learn how to build serverless applications using the platform.
Apache License 2.0
36 stars 19 forks source link

"Kind" value check fails in Creating NodeJS Actions #5

Closed jeancarl closed 8 years ago

jeancarl commented 8 years ago

For the CREATING NODEJS ACTIONS:

https://github.com/openwhisk/openwhisk-workshop/blob/master/exercises/creating_nodejs_actions/exercise.js#L9 https://github.com/openwhisk/openwhisk-workshop/blob/master/exercises/creating_nodejs_actions/exercise.js#L41 https://github.com/openwhisk/openwhisk-workshop/blob/master/exercises/creating_nodejs_actions/exercise.js#L79

Three lines check for the kind value of nodejs:6.

const uses_nodejs = (stdout.match('"kind": "nodejs:6"'))

The returned value for kind is nodejs (using an older version of wsk CLI?), not nodejs:6 (see below):

wsk action get hello-world-nodejs-delay
ok: got action hello-world-nodejs-delay
{
    "annotations": [],
    "exec": {
        "code": "function main() {\n\treturn new Promise(function(resolve, reject) {\n\t\tsetTimeout(function() {\n\t\t\tresolve({message: \"Hello World\"});\n\t\t}, 3000);\n\t});\n}\n",
        "kind": "nodejs"
    },
    "limits": {
        "logs": 10,
        "memory": 256,
        "timeout": 60000
    },
    "name": "hello-world-nodejs-delay",
    "namespace": "------------------",
    "parameters": [],
    "publish": false,
    "version": "0.0.1"
}
jthomas commented 8 years ago

That label normally indicates the Action is running in the older Node v0.12 runtime, rather than the current default v4.0.

I'll fix the code to accept any Node environment.

Thanks for reporting this.

jthomas commented 8 years ago

I've now fixed this to allow both Node runtimes. Let me know if this is still an issue.