Skip to content

Commit

Permalink
[Backport release-0.4] Fix: fix panic when workflow is skipped (#123)
Browse files Browse the repository at this point in the history
Fix: fix panic when workflow is skipped

Signed-off-by: FogDong <[email protected]>
(cherry picked from commit b3beb58)

Co-authored-by: FogDong <[email protected]>
  • Loading branch information
github-actions[bot] and FogDong committed Jan 30, 2023
1 parent e171ba4 commit d4644ef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/executor/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,20 @@ func (w *workflowExecutor) ExecuteRunners(ctx monitorContext.Context, taskRunner
return v1alpha1.WorkflowStateSucceeded, nil
}

if cacheValue, ok := StepStatusCache.Load(cacheKey); ok {
// handle cache resource
if len(status.Steps) < cacheValue.(int) {
return v1alpha1.WorkflowStateSkipped, nil
}
}

wfCtx, err := w.makeContext(ctx, w.instance.Name)
if err != nil {
ctx.Error(err, "make context")
return v1alpha1.WorkflowStateExecuting, err
}
w.wfCtx = wfCtx

if cacheValue, ok := StepStatusCache.Load(cacheKey); ok {
// handle cache resource
if len(status.Steps) < cacheValue.(int) {
return v1alpha1.WorkflowStateSkipped, nil
}
}

e := newEngine(ctx, wfCtx, w, status, taskRunners)

err = e.Run(ctx, taskRunners, dagMode)
Expand Down

0 comments on commit d4644ef

Please sign in to comment.