mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Flag-compatible IP type
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user