New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add “Set” Function #293

Open
schrieveslaach opened this Issue Oct 26, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@schrieveslaach

schrieveslaach commented Oct 26, 2018

Sometimes it is required to have a set of something. For example, I want to get a list of unique networks.

{{ range $network := set $containers "Networks" }}
   {{ $network.Name }}
{{ end }}

In this example, the $containers is a list of docker container created by groupByMulti $ "Labels.lb" ",".

The interface could be: set $containers $fieldPath (cf. groupBy)

Is it possible to provide a function like this or have I overlooked an existing function that could handle this use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment