-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible override of internal labels by the request labels #209
Comments
I think this is fixed now. Please can you take a look at the code and verify? |
I think it is still an issue, this is the relevant block on the current Lines 139 to 150 in d2a9878
Any internal labels should probably be defined as constants and should be set after we process the labels in the request, L140 in particular needs to occur after L150. |
**What** - Ensure that internal OF labels are set after user labels to ensure that users do no override these internal values - Refactor the getMinReplicaCount to work with the labels pointer, this helps simplify the control flow in the handler methods - Add constants for the label keys and update all references to those keys throughout Closes openfaas#209 Signed-off-by: Lucas Roesler <[email protected]>
**What** - Ensure that internal OF labels are set after user labels to ensure that users do no override these internal values - Refactor the getMinReplicaCount to work with the labels pointer, this helps simplify the control flow in the handler methods - Add constants for the label keys and update all references to those keys throughout Closes openfaas#209 Signed-off-by: Lucas Roesler <[email protected]>
@alexellis i have added a PR with what I think the required change is |
**What** - Ensure that internal OF labels are set after user labels to ensure that users do no override these internal values - Refactor the getMinReplicaCount to work with the labels pointer, this helps simplify the control flow in the handler methods - Add constants for the label keys and update all references to those keys throughout Closes openfaas#209 Signed-off-by: Lucas Roesler <[email protected]>
**What** - Ensure that internal OF labels are set after user labels to ensure that users do no override these internal values - Refactor the getMinReplicaCount to work with the labels pointer, this helps simplify the control flow in the handler methods - Add constants for the label keys and update all references to those keys throughout Closes openfaas#209 Signed-off-by: Lucas Roesler <[email protected]>
Currently we use the
faas_function
label as a selector in the Deployment of a function. But while debugging an issue with the selector, I noticed that we currently write all user supplied labels into the map that we supply to Kubernetes.Specifically, it looks like this
With this commit afdf2fc we explicitly require that the
faas_function
label equal the service name. If the user submits a different value forfaas_function
, it will break the deployment selector.Expected Behaviour
The
faas_function
label should be strictly controlled by thefaas
system.Current Behaviour
The value can be overridden by the user.
Possible Solution
We either need to skip select labels while processing the user input or we need to ensure that we set the important internal labels after we have process the user labels.
Steps to Reproduce (for bugs)
bar
and add the labelfaas_function: foo
Your Environment
faas-netes version: functions/faas-netesd:0.5.3
Docker version
docker version
(e.g. Docker 17.0.05 ): 18.05.0-ceWhat version and distriubtion of Kubernetes are you using?
kubectl version
The text was updated successfully, but these errors were encountered: