Skip to content

Commit a45b9cb

Browse files
authored
refactor: replace glog in global_configuration.go (#6563)
1 parent dee69a3 commit a45b9cb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

internal/k8s/global_configuration.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"reflect"
66

7-
"github.com/golang/glog"
87
"github.com/nginxinc/kubernetes-ingress/internal/configs"
8+
nl "github.com/nginxinc/kubernetes-ingress/internal/logger"
99
conf_v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1"
1010
api_v1 "k8s.io/api/core/v1"
1111
"k8s.io/apimachinery/pkg/fields"
@@ -16,30 +16,30 @@ func createGlobalConfigurationHandlers(lbc *LoadBalancerController) cache.Resour
1616
return cache.ResourceEventHandlerFuncs{
1717
AddFunc: func(obj interface{}) {
1818
gc := obj.(*conf_v1.GlobalConfiguration)
19-
glog.V(3).Infof("Adding GlobalConfiguration: %v", gc.Name)
19+
nl.Debugf(lbc.logger, "Adding GlobalConfiguration: %v", gc.Name)
2020
lbc.AddSyncQueue(gc)
2121
},
2222
DeleteFunc: func(obj interface{}) {
2323
gc, isGc := obj.(*conf_v1.GlobalConfiguration)
2424
if !isGc {
2525
deletedState, ok := obj.(cache.DeletedFinalStateUnknown)
2626
if !ok {
27-
glog.V(3).Infof("Error received unexpected object: %v", obj)
27+
nl.Debugf(lbc.logger, "Error received unexpected object: %v", obj)
2828
return
2929
}
3030
gc, ok = deletedState.Obj.(*conf_v1.GlobalConfiguration)
3131
if !ok {
32-
glog.V(3).Infof("Error DeletedFinalStateUnknown contained non-GlobalConfiguration object: %v", deletedState.Obj)
32+
nl.Debugf(lbc.logger, "Error DeletedFinalStateUnknown contained non-GlobalConfiguration object: %v", deletedState.Obj)
3333
return
3434
}
3535
}
36-
glog.V(3).Infof("Removing GlobalConfiguration: %v", gc.Name)
36+
lbc.logger.Debug(fmt.Sprintf("Removing GlobalConfiguration: %v", gc.Name))
3737
lbc.AddSyncQueue(gc)
3838
},
3939
UpdateFunc: func(old, cur interface{}) {
4040
curGc := cur.(*conf_v1.GlobalConfiguration)
4141
if !reflect.DeepEqual(old, cur) {
42-
glog.V(3).Infof("GlobalConfiguration %v changed, syncing", curGc.Name)
42+
nl.Debugf(lbc.logger, "GlobalConfiguration %v changed, syncing", curGc.Name)
4343
lbc.AddSyncQueue(curGc)
4444
}
4545
},
@@ -74,11 +74,11 @@ func (lbc *LoadBalancerController) syncGlobalConfiguration(task task) {
7474
var validationErr error
7575

7676
if !gcExists {
77-
glog.V(2).Infof("Deleting GlobalConfiguration: %v\n", key)
77+
nl.Debugf(lbc.logger, "Deleting GlobalConfiguration: %v\n", key)
7878

7979
changes, problems = lbc.configuration.DeleteGlobalConfiguration()
8080
} else {
81-
glog.V(2).Infof("Adding or Updating GlobalConfiguration: %v\n", key)
81+
nl.Debugf(lbc.logger, "Adding or Updating GlobalConfiguration: %v\n", key)
8282

8383
gc := obj.(*conf_v1.GlobalConfiguration)
8484
changes, problems, validationErr = lbc.configuration.AddOrUpdateGlobalConfiguration(gc)

0 commit comments

Comments
 (0)