Skip to content
Snippets Groups Projects
Commit f696d393 authored by Alex Ellis's avatar Alex Ellis
Browse files

Label support for Update handler


Signed-off-by: default avatarAlex Ellis <alexellis2@gmail.com>
parent e4a1ef2d
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,7 @@ func makeSpec(request *requests.CreateFunctionRequest, maxRestarts uint64, resta
}
labels := map[string]string{"function": "true"}
if request.Labels != nil {
for k, v := range request.Labels {
for k, v := range *request.Labels {
labels[k] = v
}
}
......
......@@ -93,6 +93,13 @@ func updateSpec(request *requests.CreateFunctionRequest, spec *swarm.ServiceSpec
"function": "true",
"uid": fmt.Sprintf("%d", time.Now().Nanosecond()),
}
if request.Labels != nil {
for k, v := range *request.Labels {
spec.TaskTemplate.ContainerSpec.Labels[k] = v
}
}
spec.TaskTemplate.Networks = nets
spec.TaskTemplate.Placement = &swarm.Placement{
Constraints: constraints,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment