Added configuration option to change the probe's listen address.
Change-Id: I7e8aa7bf4a4756f12211e7108cabcdc86aacd78a
diff --git a/common/probe/probe.go b/common/probe/probe.go
index fdb07e8..8a8e485 100644
--- a/common/probe/probe.go
+++ b/common/probe/probe.go
@@ -207,7 +207,7 @@
}
// ListenAndServe implements 3 HTTP endpoints on the given port for healthz, readz, and detailz. Returns only on error
-func (p *Probe) ListenAndServe(port int) {
+func (p *Probe) ListenAndServe(address string) {
mux := http.NewServeMux()
// Returns the result of the readyFunc calculation
@@ -219,7 +219,7 @@
// Returns the details of the services and their status as JSON
mux.HandleFunc("/detailz", p.detailzFunc)
s := &http.Server{
- Addr: fmt.Sprintf(":%d", port),
+ Addr: address,
Handler: mux,
}
log.Fatal(s.ListenAndServe())