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

@@ -47,11 +47,11 @@ type Server struct {
}
// ListenAndServeKubeletServer initializes a server to respond to HTTP network requests on the Kubelet.
func ListenAndServeKubeletServer(host HostInterface, updates chan<- interface{}, address string, port uint) {
func ListenAndServeKubeletServer(host HostInterface, updates chan<- interface{}, address net.IP, port uint) {
glog.V(1).Infof("Starting to listen on %s:%d", address, port)
handler := NewServer(host, updates)
s := &http.Server{
Addr: net.JoinHostPort(address, strconv.FormatUint(uint64(port), 10)),
Addr: net.JoinHostPort(address.String(), strconv.FormatUint(uint64(port), 10)),
Handler: &handler,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,