apache / openwhisk

Apache OpenWhisk is an open source serverless cloud platform
https://openwhisk.apache.org/
Apache License 2.0
6.54k stars 1.17k forks source link

Whisk.invoke object is not working in Swift3 container #1705

Closed paulcastro closed 7 years ago

paulcastro commented 7 years ago

The Whisk.invoke object is not working correctly in the Swift 3 container. If you try to use the object to invoke an action, the invoking action will always return:

"result": {
            "error": "The action did not return a dictionary."
        }
paulcastro commented 7 years ago

There appear to be two necessary changes:

  1. the open whisk environment variable that has the hostname now seems to include the protocol. We'll need to parse that
  2. We should leave the dispatch group after the callback, not in the callback. I'm not quite sure how this worked before, but its broken now.
paulcastro commented 7 years ago

I'll add a function that uses URLSession in case we want to move to that in the future. The URLCredential in Linux doesn't have a complete implementation yet so we'd be limited to invoking actions on OpenWhisk installations that have valid certificates if we switch to it now. This may be the preferred behavior but not ideal for development environments.

paulcastro commented 7 years ago

I'm re-activating test cases for Whisk object.

paulcastro commented 7 years ago

Fixed, has passed tests. Will submit PR

paulcastro commented 7 years ago

Merged PR #1718