Skip to content

Commit

Permalink
use klog for logs
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
  • Loading branch information
dvaldivia committed May 20, 2021
1 parent 138cdec commit a27a768
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/controller/cluster/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
"strconv"
"time"

"k8s.io/klog/v2"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"k8s.io/apimachinery/pkg/labels"
Expand Down Expand Up @@ -82,7 +84,7 @@ func (c *Controller) tenantsHealthMonitor() error {
healthResult, err := getMinIOHealthStatus(tenant, RegularMode)
if err != nil {
// show the error and continue
log.Println(err)
klog.V(2).Infof(err.Error())
continue
}

Expand All @@ -91,14 +93,14 @@ func (c *Controller) tenantsHealthMonitor() error {
minioSecret, err := c.kubeClientSet.CoreV1().Secrets(tenant.Namespace).Get(context.Background(), minioSecretName, metav1.GetOptions{})
if err != nil {
// show the error and continue
log.Println(err)
klog.V(2).Infof(err.Error())
continue
}

adminClnt, err := tenant.NewMinIOAdmin(minioSecret.Data)
if err != nil {
// show the error and continue
log.Println(err)
klog.V(2).Infof(err.Error())
continue
}

Expand All @@ -107,7 +109,7 @@ func (c *Controller) tenantsHealthMonitor() error {
storageInfo, err := adminClnt.StorageInfo(srvInfoCtx)
if err != nil {
// show the error and continue
log.Println(err)
klog.V(2).Infof(err.Error())
continue
}

Expand Down Expand Up @@ -137,7 +139,7 @@ func (c *Controller) tenantsHealthMonitor() error {
}

if _, err = c.updatePoolStatus(context.Background(), tenant); err != nil {
return err
klog.V(2).Infof(err.Error())
}

}
Expand Down

0 comments on commit a27a768

Please sign in to comment.