Skip to content

Commit e3ee87d

Browse files
committed
chore: more context updates
Signed-off-by: Alan Clucas <alan@clucas.org>
1 parent b53d1a3 commit e3ee87d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

workflow/controller/controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ func (wfc *WorkflowController) processNextItem(ctx context.Context) bool {
716716
if err != nil {
717717
logger.WithField("key", key).WithError(err).Warn(ctx, "Failed to unmarshal key to workflow object")
718718
woc := newWorkflowOperationCtx(ctx, wf, wfc)
719+
ctx = logging.WithLogger(ctx, woc.log)
719720
woc.markWorkflowFailed(ctx, fmt.Sprintf("cannot unmarshall spec: %s", err.Error()))
720721
woc.persistUpdates(ctx)
721722
return true
@@ -730,9 +731,10 @@ func (wfc *WorkflowController) processNextItem(ctx context.Context) bool {
730731
wfc.wfQueue.AddAfter(key, workflowResyncPeriod)
731732

732733
woc := newWorkflowOperationCtx(ctx, wf, wfc)
734+
ctx = logging.WithLogger(ctx, woc.log)
733735

734736
if (!woc.GetShutdownStrategy().Enabled() || woc.GetShutdownStrategy() != wfv1.ShutdownStrategyTerminate) && !wfc.throttler.Admit(key) {
735-
logger.WithField("key", key).Info(ctx, "Workflow processing has been postponed due to max parallelism limit")
737+
woc.log.WithField("key", key).Info(ctx, "Workflow processing has been postponed due to max parallelism limit")
736738
if woc.wf.Status.Phase == wfv1.WorkflowUnknown {
737739
woc.markWorkflowPhase(ctx, wfv1.WorkflowPending, "Workflow processing has been postponed because too many workflows are already running")
738740
woc.persistUpdates(ctx)

0 commit comments

Comments
 (0)