Skip to content

Commit

Permalink
Remove duplicated info by using WithValues()
Browse files Browse the repository at this point in the history
  • Loading branch information
panyuenlau committed Feb 7, 2022
1 parent 91ecc12 commit 7cdb0f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/kafkacluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type KafkaClusterReconciler struct {
// +kubebuilder:rbac:groups=networking.istio.io,resources=*,verbs=*

func (r *KafkaClusterReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error) {
log := logr.FromContextOrDiscard(ctx).WithValues("Request.Namespace", request.NamespacedName, "Request.Name", request.Name)
log := logr.FromContextOrDiscard(ctx)

log.Info("Reconciling KafkaCluster")

Expand Down
2 changes: 1 addition & 1 deletion controllers/kafkatopic_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type KafkaTopicReconciler struct {

// Reconcile reconciles the kafka topic
func (r *KafkaTopicReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
reqLogger := logr.FromContextOrDiscard(ctx).WithValues("kafkatopic", request.NamespacedName, "Request.Name", request.Name)
reqLogger := logr.FromContextOrDiscard(ctx)
reqLogger.Info("Reconciling KafkaTopic")
var err error

Expand Down
2 changes: 1 addition & 1 deletion controllers/kafkauser_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ type KafkaUserReconciler struct {
// Reconcile reads that state of the cluster for a KafkaUser object and makes changes based on the state read
// and what is in the KafkaUser.Spec
func (r *KafkaUserReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
reqLogger := logr.FromContextOrDiscard(ctx).WithValues("kafkauser", request.NamespacedName, "Request.Name", request.Name)
reqLogger := logr.FromContextOrDiscard(ctx)
reqLogger.Info("Reconciling KafkaUser")
var err error

Expand Down

0 comments on commit 7cdb0f6

Please sign in to comment.