File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments