Skip to content

Commit da04006

Browse files
committed
Reduce log noise from OLM
Problem: OLM produce a lot of noise in its logs while printing debug logs. Additionally, a few info logs could better be classified as debug logs and are contributing to the noise as well. Solution: Ensure that controllers created by OLM are not printing debug level logs and reclassify a few info logs as debug logs.
1 parent 2294bcc commit da04006

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cmd/olm/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func main() {
169169
}()
170170
}
171171

172-
mgr, err := Manager(ctx)
172+
mgr, err := Manager(ctx, *debug)
173173
if err != nil {
174174
logger.WithError(err).Fatalf("error configuring controller manager")
175175
}

cmd/olm/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212

1313
var log = ctrl.Log.WithName("manager")
1414

15-
func Manager(ctx context.Context) (ctrl.Manager, error) {
16-
ctrl.SetLogger(zap.Logger(true))
15+
func Manager(ctx context.Context, debug bool) (ctrl.Manager, error) {
16+
ctrl.SetLogger(zap.Logger(debug))
1717
setupLog := log.WithName("setup").V(4)
1818

1919
// Setup a Manager

pkg/controller/operators/olm/operator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ func (a *Operator) syncAPIService(obj interface{}) (syncError error) {
555555
"id": queueinformer.NewLoopID(),
556556
"apiService": apiService.GetName(),
557557
})
558-
logger.Info("syncing APIService")
558+
logger.Debug("syncing APIService")
559559

560560
if name, ns, ok := ownerutil.GetOwnerByKindLabel(apiService, v1alpha1.ClusterServiceVersionKind); ok {
561561
_, err := a.lister.CoreV1().NamespaceLister().Get(ns)
@@ -1281,7 +1281,7 @@ func (a *Operator) operatorGroupForCSV(csv *v1alpha1.ClusterServiceVersion, logg
12811281
}
12821282
return nil, nil
12831283
}
1284-
logger.Info("csv in operatorgroup")
1284+
logger.Debug("csv in operatorgroup")
12851285
return operatorGroup, nil
12861286
default:
12871287
err = fmt.Errorf("csv created in namespace with multiple operatorgroups, can't pick one automatically")

0 commit comments

Comments
 (0)