Skip to content

Commit fc7aa60

Browse files
stevekuznetsovcsrwng
authored andcommitted
chore: remove unconditional low-quality log messages from controllers
These log messages (e.g. log.Info("Reconciling"), log.Info("reconcile complete")) provide no clear information and are emitted on every reconcile invocation, leading to excessive log noise. controller-runtime already provides reconcile lifecycle tracing at debug verbosity. Remove entry/exit logs and sub-function announcement logs from 18 controllers across the CPO and HO. Clean up unused variables and imports where applicable. Signed-off-by: Cesar Wong <cewong@redhat.com> Commit-Message-Assisted-by: Claude (via Claude Code)
1 parent e09cc2d commit fc7aa60

18 files changed

Lines changed: 0 additions & 39 deletions

File tree

control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ func (r *PrivateServiceObserver) SetupWithManager(ctx context.Context, mgr ctrl.
129129
}
130130

131131
func (r *PrivateServiceObserver) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
132-
r.log.Info("reconciling")
133132

134133
// Fetch the Service
135134
svc, err := r.clientset.CoreV1().Services(req.Namespace).Get(ctx, req.Name, metav1.GetOptions{})
@@ -181,7 +180,6 @@ func (r *PrivateServiceObserver) Reconcile(ctx context.Context, req ctrl.Request
181180
}); err != nil {
182181
return ctrl.Result{}, fmt.Errorf("failed to reconcile AWSEndpointService: %w", err)
183182
}
184-
r.log.Info("reconcile complete", "request", req)
185183
return ctrl.Result{}, nil
186184
}
187185

@@ -412,8 +410,6 @@ func (r *AWSEndpointServiceReconciler) Reconcile(ctx context.Context, req ctrl.R
412410
return ctrl.Result{}, fmt.Errorf("logger not found: %w", err)
413411
}
414412

415-
log.Info("reconciling")
416-
417413
// Fetch the AWSEndpointService
418414
obj := &hyperv1.AWSEndpointService{
419415
ObjectMeta: metav1.ObjectMeta{
@@ -548,7 +544,6 @@ func (r *AWSEndpointServiceReconciler) Reconcile(ctx context.Context, req ctrl.R
548544
}
549545
}
550546

551-
log.Info("reconciliation complete")
552547
// always requeue to catch and report out of band changes in AWS
553548
// NOTICE: if the RequeueAfter interval is short enough, it could result in hitting some AWS request limits.
554549
return ctrl.Result{RequeueAfter: 5 * time.Minute}, nil

control-plane-operator/controllers/gcpprivateserviceconnect/observer.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ func (r *GCPPrivateServiceObserver) Reconcile(ctx context.Context, req ctrl.Requ
6464
return ctrl.Result{}, nil
6565
}
6666

67-
r.log.Info("reconciling")
68-
6967
// Fetch the Service
7068
svc := &corev1.Service{}
7169
if err := r.Get(ctx, req.NamespacedName, svc); err != nil {
@@ -114,7 +112,6 @@ func (r *GCPPrivateServiceObserver) Reconcile(ctx context.Context, req ctrl.Requ
114112
return ctrl.Result{}, fmt.Errorf("failed to reconcile GCPPrivateServiceConnect: %w", err)
115113
}
116114

117-
r.log.Info("reconcile complete", "request", req, "loadBalancerIP", loadBalancerIP)
118115
return ctrl.Result{}, nil
119116
}
120117

control-plane-operator/hostedclusterconfigoperator/controllers/drainer/drainer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ type Reconciler struct {
4343

4444
func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
4545
log := ctrl.LoggerFrom(ctx)
46-
log.Info("Reconciling")
4746

4847
node := &corev1.Node{}
4948
err := r.guestClusterClient.Get(ctx, req.NamespacedName, node)

control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ type Reconciler struct {
4747
}
4848

4949
func (r *Reconciler) Reconcile(ctx context.Context, req crreconcile.Request) (crreconcile.Result, error) {
50-
log := ctrl.LoggerFrom(ctx)
51-
log.Info("reconciling global pull secret")
5250

5351
// Reconcile GlobalPullSecret
5452
if err := r.reconcileGlobalPullSecret(ctx); err != nil {
@@ -77,7 +75,6 @@ func (r *Reconciler) reconcileGlobalPullSecret(ctx context.Context) error {
7775
ok bool
7876
)
7977
log := ctrl.LoggerFrom(ctx)
80-
log.Info("reconciling global pull secret")
8178

8279
// Create ServiceAccount for global-pull-secret-syncer
8380
serviceAccount := manifests.GlobalPullSecretServiceAccount()
@@ -180,8 +177,6 @@ func (r *Reconciler) reconcileGlobalPullSecret(ctx context.Context) error {
180177
}
181178

182179
func reconcileDaemonSet(ctx context.Context, daemonSet *appsv1.DaemonSet, globalPullSecretName string, originalPullSecretName string, configSeed string, c crclient.Client, createOrUpdate upsert.CreateOrUpdateFN, hccoImage string) error {
183-
log := ctrl.LoggerFrom(ctx)
184-
log.Info("Reconciling global pull secret daemon set")
185180

186181
if _, err := createOrUpdate(ctx, c, daemonSet, func() error {
187182
daemonSet.Spec = appsv1.DaemonSetSpec{

control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ func findClusterOperatorStatusCondition(conditions []configv1.ClusterOperatorSta
9999

100100
func (h *hcpStatusReconciler) reconcile(ctx context.Context, hcp *hyperv1.HostedControlPlane) error {
101101
log := ctrl.LoggerFrom(ctx)
102-
log.Info("Reconciling hosted cluster version conditions")
103102

104103
var clusterVersion configv1.ClusterVersion
105104
err := h.hostedClusterClient.Get(ctx, crclient.ObjectKey{Name: "version"}, &clusterVersion)

control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ type Reconciler struct {
7171

7272
func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
7373
log := ctrl.LoggerFrom(ctx)
74-
log.Info("Reconciling")
7574

7675
// Fetch the MachineSet.
7776
machineSet := &capiv1.MachineSet{}

control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const (
3232

3333
func (r *reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
3434
log := ctrl.LoggerFrom(ctx)
35-
log.Info("Reconciling")
3635

3736
hcp := &hyperv1.HostedControlPlane{}
3837
if err := r.client.Get(ctx, r.hcpKey, hcp); err != nil {

control-plane-operator/hostedclusterconfigoperator/controllers/node/node.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ type reconciler struct {
3636

3737
func (r *reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
3838
log := ctrl.LoggerFrom(ctx)
39-
log.Info("Reconciling")
4039

4140
node := &corev1.Node{}
4241
if err := r.guestClusterClient.Get(ctx, req.NamespacedName, node); err != nil {

control-plane-operator/hostedclusterconfigoperator/controllers/nodecount/controller.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ type reconciler struct {
2727

2828
func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (reconcile.Result, error) {
2929
log := ctrl.LoggerFrom(ctx)
30-
log.Info("Reconciling")
3130

3231
var hcp hypershiftv1beta1.HostedControlPlane
3332
if err := r.lister.Get(ctx, client.ObjectKey{

control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
"k8s.io/utils/ptr"
2222

23-
ctrl "sigs.k8s.io/controller-runtime"
2423
"sigs.k8s.io/controller-runtime/pkg/client"
2524
)
2625

@@ -61,9 +60,6 @@ var (
6160
// ReconcileKASValidatingAdmissionPolicies will create ValidatingAdmissionPolicies which block certain resources
6261
// from being updated/deleted from the DataPlane side.
6362
func ReconcileKASValidatingAdmissionPolicies(ctx context.Context, hcp *hyperv1.HostedControlPlane, client client.Client, createOrUpdate upsert.CreateOrUpdateFN) error {
64-
log := ctrl.LoggerFrom(ctx)
65-
log.Info("reconciling validating admission policies")
66-
6763
if err := reconcileConfigValidatingAdmissionPolicy(ctx, hcp, client, createOrUpdate); err != nil {
6864
return fmt.Errorf("failed to reconcile Config Validating Admission Policy: %v", err)
6965
}

0 commit comments

Comments
 (0)