Skip to content

Commit 75504b9

Browse files
exdxtimflannagan
authored andcommitted
decrease logging level to debug for noisy catalog and olm operator logs
Signed-off-by: Daniel Sover <[email protected]>
1 parent 4802ae6 commit 75504b9

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

cmd/catalog/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (o *options) run(ctx context.Context, logger *logrus.Logger) error {
121121
<-opCatalogTemplate.Ready()
122122

123123
if o.writeStatusName != "" {
124-
operatorstatus.MonitorClusterStatus(o.writeStatusName, op.AtLevel(), op.Done(), opClient, configClient, crClient)
124+
operatorstatus.MonitorClusterStatus(o.writeStatusName, op.AtLevel(), op.Done(), opClient, configClient, crClient, logger)
125125
}
126126

127127
<-op.Done()

pkg/controller/operators/catalog/operator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func (o *Operator) now() metav1.Time {
462462
func (o *Operator) syncSourceState(state grpc.SourceState) {
463463
o.sourcesLastUpdate.Set(o.now().Time)
464464

465-
o.logger.Infof("state.Key.Namespace=%s state.Key.Name=%s state.State=%s", state.Key.Namespace, state.Key.Name, state.State.String())
465+
o.logger.Debugf("state.Key.Namespace=%s state.Key.Name=%s state.State=%s", state.Key.Namespace, state.Key.Name, state.State.String())
466466
metrics.RegisterCatalogSourceState(state.Key.Name, state.Key.Namespace, state.State)
467467

468468
switch state.State {

pkg/controller/operators/catalogtemplate/operator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (o *Operator) syncCatalogSources(obj interface{}) error {
137137
"catSrcName": outputCatalogSource.GetName(),
138138
"id": queueinformer.NewLoopID(),
139139
})
140-
logger.Info("syncing catalog source for annotation templates")
140+
logger.Debug("syncing catalog source for annotation templates")
141141

142142
catalogImageTemplate := catalogsource.GetCatalogTemplateAnnotation(outputCatalogSource)
143143
if catalogImageTemplate == "" {

pkg/controller/registry/reconciler/grpc.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (c *GrpcRegistryReconciler) currentService(source grpcCatalogSourceDecorato
140140
serviceName := source.Service().GetName()
141141
service, err := c.Lister.CoreV1().ServiceLister().Services(source.GetNamespace()).Get(serviceName)
142142
if err != nil {
143-
logrus.WithField("service", serviceName).Warn("couldn't find service in cache")
143+
logrus.WithField("service", serviceName).Debug("couldn't find service in cache")
144144
return nil
145145
}
146146
return service
@@ -153,7 +153,7 @@ func (c *GrpcRegistryReconciler) currentPods(source grpcCatalogSourceDecorator)
153153
return nil
154154
}
155155
if len(pods) > 1 {
156-
logrus.WithField("selector", source.Selector()).Warn("multiple pods found for selector")
156+
logrus.WithField("selector", source.Selector()).Debug("multiple pods found for selector")
157157
}
158158
return pods
159159
}
@@ -165,7 +165,7 @@ func (c *GrpcRegistryReconciler) currentUpdatePods(source grpcCatalogSourceDecor
165165
return nil
166166
}
167167
if len(pods) > 1 {
168-
logrus.WithField("selector", source.Selector()).Warn("multiple pods found for selector")
168+
logrus.WithField("selector", source.Selector()).Debug("multiple pods found for selector")
169169
}
170170
return pods
171171
}
@@ -274,7 +274,7 @@ func (c *GrpcRegistryReconciler) ensureUpdatePod(source grpcCatalogSourceDecorat
274274
currentUpdatePods := c.currentUpdatePods(source)
275275

276276
if source.Update() && len(currentUpdatePods) == 0 {
277-
logrus.WithField("CatalogSource", source.GetName()).Infof("catalog update required at %s", time.Now().String())
277+
logrus.WithField("CatalogSource", source.GetName()).Debugf("catalog update required at %s", time.Now().String())
278278
pod, err := c.createUpdatePod(source, saName)
279279
if err != nil {
280280
return errors.Wrapf(err, "creating update catalog source pod")
@@ -315,7 +315,7 @@ func (c *GrpcRegistryReconciler) ensureUpdatePod(source grpcCatalogSourceDecorat
315315
return nil
316316
}
317317
// delete update pod right away, since the digest match, to prevent long-lived duplicate catalog pods
318-
logrus.WithField("CatalogSource", source.GetName()).Info("catalog polling result: no update")
318+
logrus.WithField("CatalogSource", source.GetName()).Debug("catalog polling result: no update")
319319
err := c.removePods([]*corev1.Pod{updatePod}, source.GetNamespace())
320320
if err != nil {
321321
return errors.Wrapf(err, "error deleting duplicate catalog polling pod: %s", updatePod.GetName())

pkg/lib/csv/replace_finder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (r *replace) IsBeingReplaced(in *v1alpha1.ClusterServiceVersion, csvsInName
4141
continue
4242
}
4343

44-
r.logger.Infof("checking %s", csv.GetName())
44+
r.logger.Debugf("checking %s", csv.GetName())
4545

4646
if csv.Spec.Replaces == in.GetName() {
4747
r.logger.Infof("%s replaced by %s", in.GetName(), csv.GetName())

pkg/lib/operatorstatus/status.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
configv1 "github.com/openshift/api/config/v1"
1111
configv1client "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1"
1212
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
13-
log "github.com/sirupsen/logrus"
13+
"github.com/sirupsen/logrus"
1414
corev1 "k8s.io/api/core/v1"
1515
k8serrors "k8s.io/apimachinery/pkg/api/errors"
1616
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -33,7 +33,8 @@ const (
3333
installPlanResource = "installplans"
3434
)
3535

36-
func MonitorClusterStatus(name string, syncCh <-chan error, stopCh <-chan struct{}, opClient operatorclient.ClientInterface, configClient configv1client.ConfigV1Interface, crClient versioned.Interface) {
36+
func MonitorClusterStatus(name string, syncCh <-chan error, stopCh <-chan struct{}, opClient operatorclient.ClientInterface,
37+
configClient configv1client.ConfigV1Interface, crClient versioned.Interface, log *logrus.Logger) {
3738
var (
3839
syncs int
3940
successfulSyncs int
@@ -123,7 +124,7 @@ func MonitorClusterStatus(name string, syncCh <-chan error, stopCh <-chan struct
123124
log.Errorf("Failed to create cluster operator: %v\n", createErr)
124125
return
125126
}
126-
created.Status.RelatedObjects, err = relatedObjects(name, opClient, crClient)
127+
created.Status.RelatedObjects, err = relatedObjects(name, opClient, crClient, log)
127128
if err != nil {
128129
log.Errorf("Failed to get related objects: %v", err)
129130
}
@@ -208,7 +209,7 @@ func MonitorClusterStatus(name string, syncCh <-chan error, stopCh <-chan struct
208209
}
209210

210211
// always update the related objects in case changes have occurred
211-
existing.Status.RelatedObjects, err = relatedObjects(name, opClient, crClient)
212+
existing.Status.RelatedObjects, err = relatedObjects(name, opClient, crClient, log)
212213
if err != nil {
213214
log.Errorf("Failed to get related objects: %v", err)
214215
}
@@ -265,9 +266,9 @@ func findOperatorStatusCondition(conditions []configv1.ClusterOperatorStatusCond
265266

266267
// relatedObjects returns RelatedObjects in the ClusterOperator.Status.
267268
// RelatedObjects are consumed by https://github.com/openshift/must-gather
268-
func relatedObjects(name string, opClient operatorclient.ClientInterface, crClient versioned.Interface) ([]configv1.ObjectReference, error) {
269+
func relatedObjects(name string, opClient operatorclient.ClientInterface, crClient versioned.Interface, log *logrus.Logger) ([]configv1.ObjectReference, error) {
269270
var objectReferences []configv1.ObjectReference
270-
log.Infof("Adding related objects for %v", name)
271+
log.Debugf("Adding related objects for %v", name)
271272
namespace := openshiftNamespace // hard-coded to constant
272273

273274
switch name {

0 commit comments

Comments
 (0)