Mesos: Use slave.PID.Host as task SlaveIP.
This commit is contained in:
parent
cd1b3904da
commit
3c7c6c4d9f
2 changed files with 5 additions and 1 deletions
|
@ -408,7 +408,7 @@ func (p *Provider) taskRecords(sj state.State) []state.Task {
|
||||||
for _, task := range f.Tasks {
|
for _, task := range f.Tasks {
|
||||||
for _, slave := range sj.Slaves {
|
for _, slave := range sj.Slaves {
|
||||||
if task.SlaveID == slave.ID {
|
if task.SlaveID == slave.ID {
|
||||||
task.SlaveIP = slave.Hostname
|
task.SlaveIP = slave.PID.Host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
|
|
||||||
"github.com/containous/traefik/log"
|
"github.com/containous/traefik/log"
|
||||||
"github.com/containous/traefik/types"
|
"github.com/containous/traefik/types"
|
||||||
|
"github.com/mesos/mesos-go/upid"
|
||||||
"github.com/mesosphere/mesos-dns/records/state"
|
"github.com/mesosphere/mesos-dns/records/state"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -194,6 +195,9 @@ func TestTaskRecords(t *testing.T) {
|
||||||
ID: "s_id",
|
ID: "s_id",
|
||||||
Hostname: "127.0.0.1",
|
Hostname: "127.0.0.1",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slave.PID.UPID = &upid.UPID{}
|
||||||
|
slave.PID.Host = slave.Hostname
|
||||||
var state = state.State{
|
var state = state.State{
|
||||||
Slaves: []state.Slave{slave},
|
Slaves: []state.Slave{slave},
|
||||||
Frameworks: []state.Framework{framework},
|
Frameworks: []state.Framework{framework},
|
||||||
|
|
Loading…
Reference in a new issue