Skip to content

Commit

Permalink
fix: Fix for missing steps in the UI
Browse files Browse the repository at this point in the history
This is a partial revert of argoproj#12130 and fixes argoproj#12165

Offered as an alternative to a full revert.

Signed-off-by: Alan Clucas <alan@clucas.org>
  • Loading branch information
Joibel committed Nov 15, 2023
1 parent 6805c91 commit 68709e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1997,8 +1997,10 @@ func (woc *wfOperationCtx) executeTemplate(ctx context.Context, nodeName string,
// Check if this is a fulfilled node for memoization.
// If so, just return this node. No more logic will be executed.
if node != nil {
woc.log.Infof("Potentially skipping node %s", nodeName)
fulfilledNode := woc.handleNodeFulfilled(nodeName, node, processedTmpl)
if fulfilledNode != nil {
woc.log.Infof("Skipping node %s", nodeName)
woc.controller.syncManager.Release(woc.wf, node.ID, processedTmpl.Synchronization)
return fulfilledNode, nil
}
Expand Down Expand Up @@ -2503,16 +2505,16 @@ func (woc *wfOperationCtx) updateAsCacheNode(node *wfv1.NodeStatus, memStat *wfv

woc.wf.Status.Nodes.Set(node.ID, *node)
woc.updated = true
woc.log.Infof("%s node %v updated %s", node.Type, node.ID, node.Phase)
}

// Update a node status that has been cached and marked as finished
func (woc *wfOperationCtx) updateAsCacheHitNode(node *wfv1.NodeStatus, outputs *wfv1.Outputs, memStat *wfv1.MemoizationStatus, message ...string) {
func (woc *wfOperationCtx) updateAsCacheHitNode(node *wfv1.NodeStatus, outputs *wfv1.Outputs, memStat *wfv1.MemoizationStatus) {
node.Phase = wfv1.NodeSucceeded
node.Outputs = outputs
node.FinishedAt = metav1.Time{Time: time.Now().UTC()}

woc.updateAsCacheNode(node, memStat)
woc.log.Infof("%s node %v updated %s%s", node.Type, node.ID, node.Phase, message)
}

// markNodePhase marks a node with the given phase, creating the node if necessary and handles timestamps
Expand Down
1 change: 1 addition & 0 deletions workflow/controller/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type stepsContext struct {
}

func (woc *wfOperationCtx) executeSteps(ctx context.Context, nodeName string, tmplCtx *templateresolution.Context, templateScope string, tmpl *wfv1.Template, orgTmpl wfv1.TemplateReferenceHolder, opts *executeTemplateOpts) (*wfv1.NodeStatus, error) {
woc.log.Infof("Executing steps %s", nodeName)
node, err := woc.wf.GetNodeByName(nodeName)
if err != nil {
node = woc.initializeExecutableNode(nodeName, wfv1.NodeTypeSteps, templateScope, tmpl, orgTmpl, opts.boundaryID, wfv1.NodeRunning, opts.nodeFlag)
Expand Down

0 comments on commit 68709e9

Please sign in to comment.