-
Notifications
You must be signed in to change notification settings - Fork 781
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
Uniq services? #434
Comments
Hi @Telmo Unfortunately this is not possible with Go's templating language. There's no way to mutate the data or create a map function 😦. Sorry! |
Folks, Is there any way to do this today? |
Hey @erolg, First a bit of book-keeping... In the future if you are interested in an issue that has been closed please consider filing a new issue and linking to the old one. This works much better as it communicates a rewnewed interest instead of being tied to a years old/closed ticket. We should probably lock these old issues to help point people in the right direction. I'm not sure if the template library changed, but this should be possible. Looking around it seems the sprig library already does this and there is a POC PR about adding sprig to consul-template. So to see progress on this front you could either vote (:+1:) for the sprig PR or file a new issue requesting the Thanks. |
@erolg, I forgot to mention in regard to your question... Using the scratch (map) template functions you might be able to do something like uniq as maps are often used like Sets to determine this sort of thing. Would be worth a look. |
I need to list all services across datacenter, this is usually not a big deal but I am running into duplicate listing if the container running the service is deployed to multiple datacenters (for redundancy)
Because the template iterates through datacenters and then services I can't find a way of de-duplicating the list. Is there a way of accomplishing this?
The text was updated successfully, but these errors were encountered: