-
Notifications
You must be signed in to change notification settings - Fork 612
Generalize where* functions #83
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
Conversation
Looks like |
Are there blockers for Go 1.4 in docker-gen, or are people importing it in other projects? Perhaps 1.4 isn't a bad thing to use (Docker, for example, very recently dropped 1.3 support) |
Good point @thaJeztah. |
I don't see any reason to keep 1.3 around. |
@md5 I removed 1.3 from travis. If you rebase, it should pass now. |
Previously, this test would fail if DOCKER_HOST was set in the calling environment
Rebased. Travis is green 👍 |
Thanks @md5! |
You're welcome! 👍 |
This PR generalizes the
where*
functions to allow an array or slice of any map or struct type.This should make it possible to fix nginx-proxy/nginx-proxy#115 since the updated
where
function can be used like this:{{where (where $container.Addresses "Proto" "tcp") "Port" "80" | len}}
to detect the case where there are multiple ports exposed but not port 80.I also introduced a
templateTestList
type with arun
function to simplify writing tests that actually execute a template and check its output. Let me know if you'd like that split into a separate PR.