Skip to content

Commit

Permalink
Fix incorrect variable name and log message
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Shen <mshen@redhat.com>
  • Loading branch information
mjlshen committed May 22, 2024
1 parent ca7d234 commit 7a2015b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cli/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var clientDo = func(client *http.Client, req *http.Request) (*http.Response, err
}

func (config *BackplaneConfiguration) getFirstWorkingProxyURL(s []string) string {
proxyHealthCheckURL := config.URL + "/healthz"
bpURL := config.URL + "/healthz"

client := &http.Client{
Timeout: 5 * time.Second,
Expand All @@ -125,7 +125,7 @@ func (config *BackplaneConfiguration) getFirstWorkingProxyURL(s []string) string
}

client.Transport = &http.Transport{Proxy: http.ProxyURL(proxyURL)}
req, _ := http.NewRequest("GET", proxyHealthCheckURL, nil)
req, _ := http.NewRequest("GET", bpURL, nil)
resp, err := clientDo(client, req)
if err != nil {
logger.Infof("Proxy: %s returned an error: %s", proxyURL, err)
Expand All @@ -134,7 +134,7 @@ func (config *BackplaneConfiguration) getFirstWorkingProxyURL(s []string) string
if resp.StatusCode == http.StatusOK {
return p
}
logger.Infof("proxy: %s did not pass healthcheck, expected response code 200, got %d, discarding", proxyHealthCheckURL, resp.StatusCode)
logger.Infof("proxy: %s did not pass healthcheck, expected response code 200, got %d, discarding", p, resp.StatusCode)
}

if len(s) > 0 {
Expand Down

0 comments on commit 7a2015b

Please sign in to comment.