Skip to content

Commit

Permalink
Changed to use klog.InfoS and klog.ErrorS
Browse files Browse the repository at this point in the history
  • Loading branch information
bells17 committed Aug 17, 2023
1 parent 9a9aef5 commit 927acd6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/livenessprobe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,24 @@ func (h *healthProbe) checkProbe(w http.ResponseWriter, req *http.Request) {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
klog.Errorf("failed to establish connection to CSI driver: %v", err)
klog.ErrorS(err, "Failed to establish connection to CSI driver")
return
}
defer conn.Close()

klog.V(5).Infof("Sending probe request to CSI driver %q", h.driverName)
klog.V(5).InfoS("Sending probe request to CSI driver", "driver", h.driverName)
ready, err := rpc.Probe(ctx, conn)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
klog.Errorf("health check failed: %v", err)
klog.ErrorS(err, "Health check failed")
return
}

if !ready {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte("driver responded but is not ready"))
klog.Error("driver responded but is not ready")
klog.Error("Driver responded but is not ready")
return
}

Expand Down Expand Up @@ -158,7 +158,7 @@ func main() {
klog.ErrorS(err, "Failed to establish connection to CSI driver")
}

klog.Info("calling CSI driver to discover driver name")
klog.Info("Calling CSI driver to discover driver name")
csiDriverName, err := rpc.GetDriverName(context.Background(), csiConn)
csiConn.Close()
if err != nil {
Expand Down

0 comments on commit 927acd6

Please sign in to comment.