kubeflow / kubeflow/trainer

Runtime reconcilers discard the enriched logger context

Open
#3,991 1 comment 0 reactions 1 assignee Claimed by @DevaanshPathak View on GitHub
area/controller kind/bug
Dominant language
Go
Stars
2.2k
Forks
1.1k
Avg merge
3d 22h
Merged PRs (30d)
39

Description

### What happened?

`TrainingRuntimeReconciler.Reconcile` and `ClusterTrainingRuntimeReconciler.Reconcile` build an object-scoped logger, then call `ctrl.LoggerInto(ctx, log)` without retaining the returned context. `LoggerInto` does not mutate the existing context, so the call is a no-op and downstream operations continue with the original reconcile logger.

The equivalent path in `TrainJobReconciler.Reconcile` correctly uses `ctx = ctrl.LoggerInto(ctx, log)`. The two runtime reconcilers should do the same so logs emitted through the context retain the `trainingRuntime` or `clusterTrainingRuntime` object identity.

### Where?

- `pkg/controller/trainingruntime_controller.go`
- `pkg/controller/clustertrainingruntime_controller.go`

### Expected behavior

The enriched logger should be stored in the context passed to subsequent reconciliation operations.

### Proposed change

Assign the returned context in both reconcilers and add focused regression coverage that verifies the object-scoped logger is available from the reconcile context.

I would like to work on a focused fix after maintainer confirmation. No PR has been opened yet.

AI assistance disclosure: OpenAI Codex assisted with repository inspection and drafting; I verified the behavior against current master.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.