apache / openwhisk-cli

Apache OpenWhisk Command Line Interface (CLI)
https://openwhisk.apache.org/
Apache License 2.0
103 stars 98 forks source link

Add env and env-file flags for action create/update #523

Open giusdp opened 1 year ago

giusdp commented 1 year ago

Following the PR that adds the Env field to the action struct in client-go https://github.com/apache/openwhisk-client-go/pull/158, this PR adds the --env and --env-file flag to wsk action create/update.

It follows closely the code for the --params and --annotation flags to add support for passing environment variables during action initialization.

I tried to extend some tests in Go but let me know where I should add more.

I've also updated the client-go dep to the latest commit and run go mod tidy which removed many deps.

kcexn commented 11 months ago

Can you explain to me how the environment variables are passed to the action initialization route in the action-proxy?

I thought the OpenWhisk-CLI simply sends requests to the OpenWhisk API? And as far as I can tell, the OpenWhisk API does not directly support passing environment variables to actions on initialization. Unless there is an undocumented annotation for it?