Closed skaegi closed 7 years ago
You could pass that explicitly as part of the feed creation? (As a workaround.)
wsk trigger create T --feed F --param endpoint xxx.yyy.zzz
This is related to https://github.com/openwhisk/openwhisk/issues/616, https://github.com/openwhisk/openwhisk/issues/218 and https://github.com/openwhisk/openwhisk/issues/387. We should add the endpoint to the context available to all the runtimes.
:) re: workaround yep using this currently...
wsk trigger create myT -f myF -p endpoint `wsk property get --apihost | awk -F"([ ][ ]+)|(\t+)" '{print $2}'`
or the package variant
wsk package create myP -p endpoint `wsk property get --apihost | awk -F"([ ][ ]+)|(\t+)" '{print $2}'`
... for anyone else who is doing this sort of thing in an install script
All actions now receive as part of their context the __OW_API_HOST
in the environment variables.
When creating a new trigger based on a feed/action the set of parameters that get passed in are... lifeCycleEvent triggerName authKey
It would be good to also pass something like "endpoint" or "triggerUrl" or support "whisk.getEndpoint()" so that we have a generic means of creating the webhook URL.
The current pattern getting promoted is like this... https://github.com/openwhisk/openwhisk-catalog/blob/master/packages/github/webhook.js#L34 ...where the "endpoint" param is set on the package. It's workable but a pain and maybe slightly error-prone.
This is going to be one of if not the most common trigger creation patterns and it's worth providing first-class support for it.