Open alexellis opened 4 years ago
I'll take this up
@alexellis Sir do we also want to put the labels from the types.FunctionDeployment by default in addition to the custom ones we apply from the cli flag?
It'd be anything that is in the struct received over HTTP
@utsavanand2 I think your PR should be a little easier now that we have merged changes for #20, here's an example of the test command, right now the labels are ignored, after your PR, they should show up here. cc @carlosedp
> faas-cli store deploy figlet --label test=true
WARNING! Communication is not secure, please consider using HTTPS. Letsencrypt.org offers free SSL/TLS certificates.
Function figlet already exists, attempting rolling-update.
Deployed. 200 OK.
URL: http://127.0.0.1:8080/function/figlet
> faas-cli describe figlet
Name: figlet
Status: Ready
Replicas: 1
Available replicas: 1
Invocations: 0
Image:
Function process:
URL: http://127.0.0.1:8080/function/figlet
Async URL: http://127.0.0.1:8080/async-function/figlet
Thanks for the help @alexellis and @carlosedp !! 😄
Add labels to the containers from the function spec
Expected Behaviour
If you create a function with a label, that label should be added to the container definition, then read back later in the list endpoint.
Current Behaviour
They are ignored
Possible Solution
I'm OK if we only store the label and don't read it back for the first PR.
Update https://github.com/alexellis/faas-containerd/blob/master/handlers/update.go and https://github.com/alexellis/faas-containerd/blob/master/handlers/deploy.go
The
types.FunctionDeployment
struct already contains labels.Steps to Reproduce (for bugs)
faas-cli store deploy figlet --label has=label
faas-cli describe figlet
The above on faas-netes / K8s will show the labels, on faas-containerd it won't