mirror of
https://github.com/containous/traefik.git
synced 2024-12-22 13:34:03 +03:00
Mesos: Use slave.PID.Host as task SlaveIP.
This commit is contained in:
parent
cd1b3904da
commit
3c7c6c4d9f
@ -408,7 +408,7 @@ func (p *Provider) taskRecords(sj state.State) []state.Task {
|
||||
for _, task := range f.Tasks {
|
||||
for _, slave := range sj.Slaves {
|
||||
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/types"
|
||||
"github.com/mesos/mesos-go/upid"
|
||||
"github.com/mesosphere/mesos-dns/records/state"
|
||||
)
|
||||
|
||||
@ -194,6 +195,9 @@ func TestTaskRecords(t *testing.T) {
|
||||
ID: "s_id",
|
||||
Hostname: "127.0.0.1",
|
||||
}
|
||||
|
||||
slave.PID.UPID = &upid.UPID{}
|
||||
slave.PID.Host = slave.Hostname
|
||||
var state = state.State{
|
||||
Slaves: []state.Slave{slave},
|
||||
Frameworks: []state.Framework{framework},
|
||||
|
Loading…
Reference in New Issue
Block a user