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

Add label support to Swarm


Signed-off-by: default avatarAlex Ellis <alexellis2@gmail.com>
parent 35f0e9e6
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,12 @@ func makeSpec(request *requests.CreateFunctionRequest, maxRestarts uint64, resta
} else {
constraints = linuxOnlyConstraints
}
labels := map[string]string{"function": "true"}
if request.Labels != nil {
for k, v := range request.Labels {
labels[k] = v
}
}
labels := map[string]string{
"com.openfaas.function": request.Service,
......@@ -129,6 +135,10 @@ func makeSpec(request *requests.CreateFunctionRequest, maxRestarts uint64, resta
Replicas: getMinReplicas(request),
},
},
Annotations: swarm.Annotations{
Name: request.Service,
Labels: labels,
},
}
// TODO: request.EnvProcess should only be set if it's not nil, otherwise we override anything in the Docker image already
......
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