You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the constraints array is not reset every time, you will have unintended functions in your stack YAML get constraints that were intended for only one function.
Can be fixed by resetting the constraints array to nil if *function.Constraints is nil. Otherwise, it will set the constraints array in one iteration of the loop, then next iteration *functions.Constraints will be null, but constraints array will not be set back to nil, so the next function will also wrongly get the constraint applied.
Expected Behaviour
When only one function in the stack YAML has a constraint, only that function gets the constraint.
Current Behaviour
Other functions will inherit the constraint if they happen to get deployed after the function that has a constraint applied.
Possible Solution
Remove the if statement surrounding constraints = *function.Constraints. It should unconditionally set this variable.
Make sure there are other functions in the stack YAML
2. fc deploy , and if there are functions that are deployed after url-ping, they will also have the constraint env=true applied.
3.
4.
Because the constraints array is not reset every time, you will have unintended functions in your stack YAML get constraints that were intended for only one function.
Consider this if statement:
faas-cli/commands/deploy.go
Line 136 in 5a79f8f
Can be fixed by resetting the constraints array to
nil
if*function.Constraints
is nil. Otherwise, it will set theconstraints
array in one iteration of the loop, then next iteration*functions.Constraints
will be null, butconstraints
array will not be set back tonil
, so the next function will also wrongly get the constraint applied.Expected Behaviour
When only one function in the stack YAML has a constraint, only that function gets the constraint.
Current Behaviour
Other functions will inherit the constraint if they happen to get deployed after the function that has a constraint applied.
Possible Solution
Remove the if statement surrounding
constraints = *function.Constraints
. It should unconditionally set this variable.Steps to Reproduce (for bugs)
Make sure there are other functions in the stack YAML
2.
fc deploy
, and if there are functions that are deployed afterurl-ping
, they will also have the constraintenv=true
applied.3.
4.
Context
Testing out Node selector (openfaas/faas-netes#77), deploying with the faas-cli.
Your Environment
Docker version
docker version
(e.g. Docker 17.0.05 ):Docker version 1.12.6, build 78d1802
Are you using Docker Swarm or Kubernetes (FaaS-netes)?
Kubernetes 1.8.2
Operating System and version (e.g. Linux, Windows, MacOS):
ubuntu 1604 on ec2
Link to your project or a code example to reproduce issue:
The text was updated successfully, but these errors were encountered: