@@ -30,8 +30,8 @@ import (
30
30
"k8s.io/client-go/tools/leaderelection/resourcelock"
31
31
"k8s.io/client-go/tools/record"
32
32
"k8s.io/client-go/util/workqueue"
33
+ "k8s.io/klog/v2"
33
34
34
- "github.com/golang/glog"
35
35
"github.com/spf13/viper"
36
36
)
37
37
@@ -223,14 +223,14 @@ func (c *ObjectStorageController) Run(ctx context.Context) error {
223
223
RetryPeriod : c .RetryPeriod ,
224
224
Callbacks : leaderelection.LeaderCallbacks {
225
225
OnStartedLeading : func (ctx context.Context ) {
226
- glog .V (2 ).Info ("became leader, starting" )
226
+ klog .V (2 ).InfoS ("became leader, starting controller " )
227
227
c .runController (ctx )
228
228
},
229
229
OnStoppedLeading : func () {
230
- glog . Infof ("stopped leading" )
230
+ klog . InfoS ("stopped leading" )
231
231
},
232
232
OnNewLeader : func (identity string ) {
233
- glog .V (3 ).Infof ("new leader detected, current leader: %s " , identity )
233
+ klog .V (3 ).InfoS ("new leader detected" , "name " , identity )
234
234
},
235
235
},
236
236
}
@@ -275,8 +275,6 @@ func (c *ObjectStorageController) processNextItem(ctx context.Context) bool {
275
275
err = add (ctx , o .Object )
276
276
if err == nil {
277
277
o .Indexer .Add (o .Object )
278
- } else {
279
- glog .Errorf ("Error adding %s %s: %v" , ns , name , err )
280
278
}
281
279
case updateOp :
282
280
update := * o .UpdateFunc
@@ -286,8 +284,6 @@ func (c *ObjectStorageController) processNextItem(ctx context.Context) bool {
286
284
err = update (ctx , o .OldObject , o .NewObject )
287
285
if err == nil {
288
286
o .Indexer .Update (o .NewObject )
289
- } else {
290
- glog .Errorf ("Error updating %s %s: %v" , ns , name , err )
291
287
}
292
288
case deleteOp :
293
289
delete := * o .DeleteFunc
@@ -297,8 +293,6 @@ func (c *ObjectStorageController) processNextItem(ctx context.Context) bool {
297
293
err = delete (ctx , o .Object )
298
294
if err == nil {
299
295
o .Indexer .Delete (o .Object )
300
- } else {
301
- glog .Errorf ("Error deleting %s %s: %v" , ns , name , err )
302
296
}
303
297
default :
304
298
panic ("unknown item in queue" )
@@ -425,7 +419,6 @@ func (c *ObjectStorageController) runController(ctx context.Context) {
425
419
defer utilruntime .HandleCrash ()
426
420
defer c .queue .ShutDown ()
427
421
428
- glog .V (1 ).Infof ("Starting %s controller" , name )
429
422
go ctrlr .Run (ctx .Done ())
430
423
431
424
if ! cache .WaitForCacheSync (ctx .Done (), ctrlr .HasSynced ) {
@@ -438,7 +431,6 @@ func (c *ObjectStorageController) runController(ctx context.Context) {
438
431
}
439
432
440
433
<- ctx .Done ()
441
- glog .V (3 ).Infof ("Stopping %s controller" , name )
442
434
}
443
435
444
436
if c .BucketListener != nil {
0 commit comments