It seems that the connector-sdk maps all functions ignoring the namespace they are in. This is a problem, specially in multi-tenant environments.
Expected Behaviour
Configuration should accept a namespace in order to get only the functions deployed in that namespace.
Current Behaviour
At this moment, all functions are mapped without taking the function's namespace into account.
Possible Solution
Adding a Namespace attribute to ControllerConfig would allow to filter functions by namespace. If the namespace is not set, the namespace value would be empty (by default) and everything would work as usual, so it wouldn't be a breaking change but a feature. Connectors (mqtt-connector, rabbitmq-connector...) will need to add support to set a namespace, e.g. using an environment variable.
I added a pull request to add support for namespace filtering that shows how I've tried to solve this problem.
Context
I'm working in a multi-tenant platform that allows users to deploy their own functions. In order to group functions by users, they are deployed in different namespaces. The same way, users should be able to deploy connectors that must only invoke the functions deployed in the user's namespace.
Your Environment
FaaS-CLI version ( Full output from: faas-cli version ):
commit: c12d57c39ac4cc6eef3c9bba2fb45113d882432f
version: 0.12.14
Docker version docker version (e.g. Docker 17.0.05 ): Docker 19.03.12
Are you using Docker Swarm or Kubernetes (FaaS-netes)? No
Operating System and version (e.g. Linux, Windows, MacOS): Linux
My actions before raising this issue
It seems that the
connector-sdk
maps all functions ignoring the namespace they are in. This is a problem, specially in multi-tenant environments.Expected Behaviour
Configuration should accept a namespace in order to get only the functions deployed in that namespace.
Current Behaviour
At this moment, all functions are mapped without taking the function's namespace into account.
Possible Solution
Adding a
Namespace
attribute toControllerConfig
would allow to filter functions by namespace. If the namespace is not set, the namespace value would be empty (by default) and everything would work as usual, so it wouldn't be a breaking change but a feature. Connectors (mqtt-connector, rabbitmq-connector...) will need to add support to set a namespace, e.g. using an environment variable.I added a pull request to add support for namespace filtering that shows how I've tried to solve this problem.
Context
I'm working in a multi-tenant platform that allows users to deploy their own functions. In order to group functions by users, they are deployed in different namespaces. The same way, users should be able to deploy connectors that must only invoke the functions deployed in the user's namespace.
Your Environment
FaaS-CLI version ( Full output from:
faas-cli version
): commit: c12d57c39ac4cc6eef3c9bba2fb45113d882432f version: 0.12.14Docker version
docker version
(e.g. Docker 17.0.05 ): Docker 19.03.12Are you using Docker Swarm or Kubernetes (FaaS-netes)? No
Operating System and version (e.g. Linux, Windows, MacOS): Linux