Merge pull request #1645 from aledbf/avoid-localhost
Do not use localhost in checks
This commit is contained in:
commit
4150de7971
2 changed files with 3 additions and 3 deletions
|
@ -734,7 +734,7 @@ func (n NGINXController) Name() string {
|
||||||
|
|
||||||
// Check returns if the nginx healthz endpoint is returning ok (status code 200)
|
// Check returns if the nginx healthz endpoint is returning ok (status code 200)
|
||||||
func (n NGINXController) Check(_ *http.Request) error {
|
func (n NGINXController) Check(_ *http.Request) error {
|
||||||
res, err := http.Get(fmt.Sprintf("http://localhost:%v%v", n.ports.Status, ngxHealthPath))
|
res, err := http.Get(fmt.Sprintf("http://0.0.0.0:%v%v", n.ports.Status, ngxHealthPath))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ func (bit BoolToFloat64) UnmarshalJSON(data []byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getNginxStatus(port int, path string) (*basicStatus, error) {
|
func getNginxStatus(port int, path string) (*basicStatus, error) {
|
||||||
url := fmt.Sprintf("http://localhost:%v%v", port, path)
|
url := fmt.Sprintf("http://0.0.0.0:%v%v", port, path)
|
||||||
glog.V(3).Infof("start scraping url: %v", url)
|
glog.V(3).Infof("start scraping url: %v", url)
|
||||||
|
|
||||||
data, err := httpBody(url)
|
data, err := httpBody(url)
|
||||||
|
@ -175,7 +175,7 @@ func httpBody(url string) ([]byte, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getNginxVtsMetrics(port int, path string) (*vts, error) {
|
func getNginxVtsMetrics(port int, path string) (*vts, error) {
|
||||||
url := fmt.Sprintf("http://localhost:%v%v", port, path)
|
url := fmt.Sprintf("http://0.0.0.0:%v%v", port, path)
|
||||||
glog.V(3).Infof("start scraping url: %v", url)
|
glog.V(3).Infof("start scraping url: %v", url)
|
||||||
|
|
||||||
data, err := httpBody(url)
|
data, err := httpBody(url)
|
||||||
|
|
Loading…
Reference in a new issue