[Proposal] docker service create template support for Node labels
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.7k
- Forks
- 676
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 6
Description
Currently supported Templates regarding the Nodes
Currently only two templates {{ .Node.ID }} and {{ .Node.Hostname }} are supported. This is nice, but labels would put these templates on another level in terms of possibilities.
How could this look
The template could be something like {{ .Node.Spec.Labels.[label name] }}.
If the label is not found the value "", "null" or "<no value>" (as it's currently done using docker node inspect) should be used.
Summary
Dockers templates for service creation should support node labels.
The result of the template {{ .Node.Spec.Labels.example_label }} should be the same as the output of docker node inspect -f="{{ .Spec.Labels.example_label }}" node_name.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the existing service-creation template handling for .Node.ID and .Node.Hostname, then find its related tests or entry point. Compare the proposed .Node.Spec.Labels.example_label behavior with docker node inspect; done means node labels render correctly and missing labels produce an agreed empty or placeholder value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100