Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

namespace is not required in wskprops #3

Closed
alexkli opened this issue Aug 5, 2019 · 4 comments
Closed

namespace is not required in wskprops #3

alexkli opened this issue Aug 5, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@alexkli
Copy link
Contributor

alexkli commented Aug 5, 2019

Originally reported by @ddragosd:

This OpenWhisk PR apache/openwhisk-cli#434 removed this.

This is also referenced in https://lists.apache.org/thread.html/cb315e7e7c3fcaa419aae67e1b00e7aafe94c7e2af09b71fd4ce68bb@%3Cdev.openwhisk.apache.org%3E

We can probably fetch it dynamically.

@alexkli
Copy link
Contributor Author

alexkli commented Aug 5, 2019

Query for affected code

If fetching it dynamically, it should probably happen after this line and then set this.wskProps.namespace, from which all other places take it later.

@alexkli alexkli added the bug Something isn't working label Aug 5, 2019
alexkli added a commit that referenced this issue Aug 5, 2019
@alexkli alexkli self-assigned this Aug 6, 2019
@alexkli
Copy link
Contributor Author

alexkli commented Aug 6, 2019

@ddragosd did you see an actual error?

When I tried this, the only thing that seems to be off is that wskdebug logs slightly wrong:

Starting debugger for /undefined/wskdebug-examples/webaction

Note the undefined instead of the correct namespace name.

But it still runs fine. It seems that if no namespace is given, openwhisk figures out the namespace itself, and that actually trickles down everywhere.

Versions used:

  • npm openwhisk version 3.19.0
  • wsk version 2019-03-20T20:17:38.064+0000
  • openwhisk - tested against both old 2018-01-29T18:32:59Z and newer 2019-08-01 - a

@alexkli
Copy link
Contributor Author

alexkli commented Aug 6, 2019

Ok, I can see a potential issue because of this line:

action_name : `/${this.wskProps.namespace}/${this.actionName}`,

The action_name here is turned into the __OW_ACTION_NAME environment variable available inside the container. This must have the correct namespace in case an action is parsing this.

alexkli added a commit that referenced this issue Aug 6, 2019
@alexkli
Copy link
Contributor Author

alexkli commented Aug 6, 2019

Fixed in 7959a67.

I simply update the this.wskProps.namespace field that is used internally by wskdebug. This does not change the this.wsk instance of openwhisk(), because this would be a chicken and egg scenario, where I had to use the first one only to get the namespace and then create another instance with the now known namespace. But as mentioned above, it seems to happily work without the namespace configured in the constructor.

@alexkli alexkli closed this as completed Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant