Skip to content

Commit b454847

Browse files
authored
Merge pull request #28 from sbezverk/release_1.0_26
Merge pull request #27 from sbezverk/issue_26
2 parents 857ef60 + 04a9eb5 commit b454847

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ func getCSIConnection() (connection.CSIConnection, error) {
6767
return csiConn, nil
6868
}
6969

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

9797
addr := net.JoinHostPort("0.0.0.0", *healthzPort)
98-
http.HandleFunc("/healthz", chekcHealth)
98+
http.HandleFunc("/healthz", checkHealth)
9999
glog.Infof("Serving requests to /healthz on: %s", addr)
100100
err := http.ListenAndServe(addr, nil)
101101
if err != nil {

0 commit comments

Comments
 (0)