Skip to content

Commit

Permalink
Merge pull request #28 from sbezverk/release_1.0_26
Browse files Browse the repository at this point in the history
Merge pull request #27 from sbezverk/issue_26
  • Loading branch information
k8s-ci-robot authored Dec 20, 2018
2 parents 857ef60 + 04a9eb5 commit b454847
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ func getCSIConnection() (connection.CSIConnection, error) {
return csiConn, nil
}

func chekcHealth(w http.ResponseWriter, req *http.Request) {

func checkHealth(w http.ResponseWriter, req *http.Request) {
glog.Infof("Request: %s from: %s\n", req.URL.Path, req.RemoteAddr)
csiConn, err := getCSIConnection()
if err != nil {
Expand All @@ -77,6 +76,7 @@ func chekcHealth(w http.ResponseWriter, req *http.Request) {
glog.Infof("Failed to get connection to CSI with error: %v.", err)
return
}
defer csiConn.Close()
ctx, cancel := context.WithTimeout(context.Background(), *connectionTimeout)
defer cancel()
if err := runProbe(ctx, csiConn); err != nil {
Expand All @@ -95,7 +95,7 @@ func main() {
flag.Parse()

addr := net.JoinHostPort("0.0.0.0", *healthzPort)
http.HandleFunc("/healthz", chekcHealth)
http.HandleFunc("/healthz", checkHealth)
glog.Infof("Serving requests to /healthz on: %s", addr)
err := http.ListenAndServe(addr, nil)
if err != nil {
Expand Down

0 comments on commit b454847

Please sign in to comment.