openfaas / faas-netes

Serverless Functions For Kubernetes
https://www.openfaas.com
MIT License
2.13k stars 472 forks source link

Functions are manipulated in non-annotated namespace #679

Open martindekov opened 4 years ago

martindekov commented 4 years ago

Functions should only be created/deleted etc. In namespaces which have annotation openfaas=1/true in faas-netes and operator. Currently the logic rejects secrets created in those namespaces, but creates functions.

Expected Behaviour

Try creating function in namespace which does not have annotation results in failure.

Current Behaviour

Creating function in namespace with no openfaas=1 annotation succeeds.

Possible Solution

Check query namespaces before creating function similar to logic in handlers.ListNamespaces

Steps to Reproduce (for bugs)

  1. Deploy faas-netes/operator with ClusterRole to true to enable multiple namespaces support
  2. Create namespace staging-fn without annotation
  3. Create function check it succeeds
  4. Create secret and check 4xx status

Context

Similar problem exists while developing multiple namespaces support for the operator.

Your Environment

alexellis commented 4 years ago

Is this fixed by #673 @martindekov ?

martindekov commented 4 years ago

No Alex, I will open separate PR with this change.