Merge pull request #1584 from thockin/net

Flag-compatible IP type
This commit is contained in:
Brendan Burns
2014-10-06 13:35:48 -07:00
10 changed files with 74 additions and 28 deletions

View File

@@ -39,11 +39,12 @@ import (
var (
port = flag.Int("port", masterPkg.ControllerManagerPort, "The port that the controller-manager'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)
}
@@ -63,7 +64,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)
endpoints := service.NewEndpointController(kubeClient)
go util.Forever(func() { endpoints.SyncServiceEndpoints() }, time.Second*10)