always override hostname in mesos

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
Victor Vieux 2015-07-01 17:01:57 -07:00
parent f80556ce9c
commit edb72d0744
1 changed files with 10 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"os"
"sort"
"sync"
"time"
@ -72,10 +73,16 @@ func NewCluster(scheduler *scheduler.Scheduler, store *state.Store, TLSConfig *t
// Empty string is accepted by the scheduler.
user, _ := options.String("mesos.user", "SWARM_MESOS_USER")
// Override the hostname here because mesos-go will try
// to shell out to the hostname binary and it won't work with our official image.
// Do not check error here, so mesos-go can still try.
hostname, _ := os.Hostname()
driverConfig := mesosscheduler.DriverConfig{
Scheduler: cluster,
Framework: &mesosproto.FrameworkInfo{Name: proto.String(frameworkName), User: &user},
Master: cluster.master,
Scheduler: cluster,
Framework: &mesosproto.FrameworkInfo{Name: proto.String(frameworkName), User: &user},
Master: cluster.master,
HostnameOverride: hostname,
}
// Changing port for https