I have been playing around with Marathoner today, and I must admit I really like it.
But I feel like something is wrong in the way you are using ports returned by Marathon API.
Also, sorry I can not just make a pull request, as I am not able to code using Go...
AFAIK, Marathon will "generate" a random and unbound port for each instance of this application.
Let's say I run an instance on a slave which IP is 192.168.1.1, and the generated ports are 10000.
The result I expected when using Marathoner for HAProxy would have been as follow:
Proxy 127.0.0.1:9200 to 192.168.1.1:10000
Your code makes it clear that it does not handle auto-generated ports:
// servicePort for docker can be set, but ports still can be [0]
// it's better to skip such apps for now
foundEmptyPort := false
for _, p := range a.Ports {
if p == 0 {
foundEmptyPort = true
break
}
}
Why did you put such a limit there ?
Being a recent user of Marathon, I may also be mistaken. :)
Thanks for the support !
Hi,
I have been playing around with Marathoner today, and I must admit I really like it. But I feel like something is wrong in the way you are using ports returned by Marathon API. Also, sorry I can not just make a pull request, as I am not able to code using Go...
Here is my Marathon app:
AFAIK, Marathon will "generate" a random and unbound port for each instance of this application. Let's say I run an instance on a slave which IP is 192.168.1.1, and the generated ports are 10000.
The result I expected when using Marathoner for HAProxy would have been as follow: Proxy 127.0.0.1:9200 to 192.168.1.1:10000
Your code makes it clear that it does not handle auto-generated ports:
Why did you put such a limit there ? Being a recent user of Marathon, I may also be mistaken. :) Thanks for the support !