Flag-compatible IP type

This commit is contained in:
Tim Hockin
2014-10-03 21:34:30 -07:00
parent a0bb739609
commit 0ad0a247c4
10 changed files with 74 additions and 28 deletions

View File

@@ -34,11 +34,12 @@ import (
var (
port = flag.Int("port", masterPkg.SchedulerPort, "The port that the scheduler's http service runs on")
address = flag.String("address", "127.0.0.1", "The address to serve from")
address = util.IP(net.ParseIP("127.0.0.1"))
clientConfig = &client.Config{}
)
func init() {
flag.Var(&address, "address", "The IP address to serve on (set to 0.0.0.0 for all interfaces)")
client.BindClientConfigFlags(flag.CommandLine, clientConfig)
}
@@ -54,7 +55,7 @@ func main() {
glog.Fatalf("Invalid API configuration: %v", err)
}
go http.ListenAndServe(net.JoinHostPort(*address, strconv.Itoa(*port)), nil)
go http.ListenAndServe(net.JoinHostPort(address.String(), strconv.Itoa(*port)), nil)
configFactory := &factory.ConfigFactory{Client: kubeClient}
config := configFactory.Create()