habitat icon indicating copy to clipboard operation
habitat copied to clipboard

Provide a way to filter the current node from a list of group members

Open christophermaier opened this issue 6 years ago • 3 comments

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!

christophermaier avatar May 11 '18 01:05 christophermaier

Confirmed valid in v0.57

baumanj avatar Jun 19 '18 19:06 baumanj

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.

stale[bot] avatar Apr 03 '20 06:04 stale[bot]

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.

stale[bot] avatar Aug 12 '22 00:08 stale[bot]