habitat
habitat copied to clipboard
Provide a way to filter the current node from a list of group members
In templates, we don't really have a good way to filter the current node from the list of all members of its service group.
This could be necessary if you need to configure yourself with a list of peer services, but where passing "yourself" is nonsensical or an error.
There are a few ways we could go about this:
- Provide a helper function, similar to
eachAlive
, that filters the single service member out of a list. This would take a bit of work on the backend, but would give slightly more expressive templates. - Add an
is_me
boolean flag to all service members, which can be use in boolean expressions. This is probably the easiest to implement, but would require more work on the part of the template author. - Provide pre-filtered lists directly to the user. This would make for the most concise and expressive templates, at the cost of consuming more resources.
Other thoughts and suggestions are welcome!
Confirmed valid in v0.57
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.