Skip to content

Commit f20183e

Browse files
committed
EvictionController: Fix unused logger context return value
Assign the return value of logger.IntoContext() back to ctx so that subsequent calls using ctx will have the enriched logger with additional fields (server, server_status).
1 parent 0e58200 commit f20183e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/controller/eviction_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func (r *EvictionReconciler) evictNext(ctx context.Context, eviction *kvmv1.Evic
275275
return ctrl.Result{}, nil
276276
}
277277
log := logger.FromContext(ctx).WithName("Evict").WithValues("server", uuid)
278-
logger.IntoContext(ctx, log)
278+
ctx = logger.IntoContext(ctx, log)
279279

280280
res := servers.Get(ctx, r.computeClient, uuid)
281281
vm, err := res.Extract()
@@ -289,7 +289,7 @@ func (r *EvictionReconciler) evictNext(ctx context.Context, eviction *kvmv1.Evic
289289
}
290290

291291
log = log.WithValues("server_status", vm.Status)
292-
logger.IntoContext(ctx, log)
292+
ctx = logger.IntoContext(ctx, log)
293293

294294
// First, check the transient statuses
295295
switch vm.Status {

0 commit comments

Comments
 (0)