Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.5.2-atlan-0.9.1 #12

Open
wants to merge 16 commits into
base: release-3.5.2
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: enable various lastRetry parameters in podspecpatch
Signed-off-by: Tianchu Zhao <evantczhao@gmail.com>
tczhao committed Jun 18, 2024
commit eba7bababfa0d4d86c21729acbb4917a38b84a7e
10 changes: 10 additions & 0 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
@@ -1777,6 +1777,10 @@ func getRetryNodeChildrenIds(node *wfv1.NodeStatus, nodes wfv1.Nodes) []string {

func buildRetryStrategyLocalScope(node *wfv1.NodeStatus, nodes wfv1.Nodes) map[string]interface{} {
localScope := make(map[string]interface{})
localScope[common.LocalVarRetriesLastExitCode] = "0"
localScope[common.LocalVarRetriesLastStatus] = ""
localScope[common.LocalVarRetriesLastDuration] = "0"
localScope[common.LocalVarRetriesLastMessage] = ""

// `retries` variable
childNodeIds, lastChildNode := getChildNodeIdsAndLastRetriedNode(node, nodes)
@@ -2076,6 +2080,12 @@ func (woc *wfOperationCtx) executeTemplate(ctx context.Context, nodeName string,
nodeName = lastChildNode.Name
node = lastChildNode
} else {
localScope := buildRetryStrategyLocalScope(retryParentNode, woc.wf.Status.Nodes)
for key, value := range localScope {
strKey := fmt.Sprintf("%v", key)
strValue := fmt.Sprintf("%v", value)
localParams[strKey] = strValue
}
retryNum := len(childNodeIDs)
// Create a new child node and append it to the retry node.
nodeName = fmt.Sprintf("%s(%d)", retryNodeName, retryNum)