Skip to content

Commit a39ff2f

Browse files
committed
fix: Add controller prefix to duplicate log messages
Two different controllers are watching the same Secret changes and both logging when they detect that a keystone-related resource has changed. This commit add controller prefix to both controllers: - Add [ControlPlane] prefix to OpenStackControlPlane controller log - Add [Client] prefix to OpenStackClient controller log Benefits: - Immediate differentiation of log sources - Low risk, minimal code changes - Maintains all existing functionality - Improved operator debugging experience Before: 'input source keystone changed, reconcile: nova - openstack' 'input source keystone changed, reconcile: nova - openstack' After: '[ControlPlane] input source keystone changed, reconcile: nova - openstack' '[Client] input source keystone changed, reconcile: nova - openstack' Fixes: #duplicate-logs Assisted by: claude-4-sonnet
1 parent cf133b3 commit a39ff2f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

controllers/client/openstackclient_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ func (r *OpenStackClientReconciler) findObjectsForSrc(ctx context.Context, src c
542542
}
543543

544544
for _, item := range crList.Items {
545-
Log.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
545+
Log.Info(fmt.Sprintf("[Client] input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
546546

547547
requests = append(requests,
548548
reconcile.Request{

controllers/core/openstackcontrolplane_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ func (r *OpenStackControlPlaneReconciler) findObjectsForSrc(ctx context.Context,
758758
}
759759

760760
for _, item := range crList.Items {
761-
Log.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
761+
Log.Info(fmt.Sprintf("[ControlPlane] input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
762762

763763
requests = append(requests,
764764
reconcile.Request{

0 commit comments

Comments
 (0)