@@ -51,20 +51,15 @@ func runProbe(ctx context.Context, csiConn connection.CSIConnection) error {
51
51
glog .Infof ("CSI driver name: %q" , csiDriverName )
52
52
// Sending Probe request
53
53
glog .Infof ("Sending probe request to CSI driver." )
54
- if err := csiConn .LivenessProbe (ctx ); err != nil {
55
- return err
56
- }
57
- return nil
54
+ err = csiConn .LivenessProbe (ctx )
55
+ return err
58
56
}
59
57
60
58
func getCSIConnection () (connection.CSIConnection , error ) {
61
59
// Connect to CSI.
62
60
glog .Infof ("Attempting to open a gRPC connection with: %s" , * csiAddress )
63
61
csiConn , err := connection .NewConnection (* csiAddress , * connectionTimeout )
64
- if err != nil {
65
- return nil , err
66
- }
67
- return csiConn , nil
62
+ return csiConn , err
68
63
}
69
64
70
65
func checkHealth (w http.ResponseWriter , req * http.Request ) {
@@ -73,7 +68,7 @@ func checkHealth(w http.ResponseWriter, req *http.Request) {
73
68
if err != nil {
74
69
w .WriteHeader (http .StatusInternalServerError )
75
70
w .Write ([]byte (err .Error ()))
76
- glog .Infof ("Failed to get connection to CSI with error: %v." , err )
71
+ glog .Errorf ("Failed to get connection to CSI with error: %v." , err )
77
72
return
78
73
}
79
74
defer csiConn .Close ()
@@ -82,7 +77,7 @@ func checkHealth(w http.ResponseWriter, req *http.Request) {
82
77
if err := runProbe (ctx , csiConn ); err != nil {
83
78
w .WriteHeader (http .StatusInternalServerError )
84
79
w .Write ([]byte (err .Error ()))
85
- glog .Infof ("Health check failed with: %v." , err )
80
+ glog .Errorf ("Health check failed with: %v." , err )
86
81
} else {
87
82
w .WriteHeader (http .StatusOK )
88
83
w .Write ([]byte (`ok` ))
0 commit comments