Skip to content

Commit 817244e

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 499dcef commit 817244e

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
@@ -241,7 +241,7 @@ func (r *EvictionReconciler) evictNext(ctx context.Context, eviction *kvmv1.Evic
241241
instances := &eviction.Status.OutstandingInstances
242242
uuid := (*instances)[len(*instances)-1]
243243
log := logger.FromContext(ctx).WithName("Evict").WithValues("server", uuid)
244-
logger.IntoContext(ctx, log)
244+
ctx = logger.IntoContext(ctx, log)
245245

246246
res := servers.Get(ctx, r.computeClient, uuid)
247247
vm, err := res.Extract()
@@ -255,7 +255,7 @@ func (r *EvictionReconciler) evictNext(ctx context.Context, eviction *kvmv1.Evic
255255
}
256256

257257
log = log.WithValues("server_status", vm.Status)
258-
logger.IntoContext(ctx, log)
258+
ctx = logger.IntoContext(ctx, log)
259259

260260
// First, check the transient statuses
261261
switch vm.Status {

0 commit comments

Comments
 (0)