feat: allow lastRetry variables in expressions#12722
feat: allow lastRetry variables in expressions#12722eduardodbr wants to merge 4 commits intoargoproj:mainfrom
Conversation
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
Signed-off-by: eduardodbr <eduardodbr@hotmail.com>
| localParams[common.LocalVarRetriesLastDuration] = lastRetryDuration | ||
| localParams[common.LocalVarRetriesLastStatus] = lastRetryStatus | ||
| localParams[common.LocalVarRetriesLastMessage] = lastRetryMessage | ||
|
|
There was a problem hiding this comment.
Since this function is already so long, can we separate this new logic into a function to build the local scope from lastChildNode?
There was a problem hiding this comment.
Ignore this comment if this comment ends up making more sense
There was a problem hiding this comment.
we could use the output from buildRetryStrategyLocalScope,
and add them in localParams
| @@ -2128,6 +2128,24 @@ func (woc *wfOperationCtx) executeTemplate(ctx context.Context, nodeName string, | |||
| // Inject the retryAttempt number | |||
| localParams[common.LocalVarRetries] = strconv.Itoa(retryNum) | |||
There was a problem hiding this comment.
Since we're already using LocalVarRetries in this scope, it does seem reasonable to me to use these other variables in the general template scope as well.
There was a problem hiding this comment.
Actually, I haven't looked at it long enough, but I am kind of wondering if there's a way to do this and not have to be setting these same variables twice. Should processNodeRetries() possibly take a localScope and then be able to modify it and return it to the caller? You have probably looked at the code longer than I have - what do you think?
| localParams[common.LocalVarRetriesLastDuration] = lastRetryDuration | ||
| localParams[common.LocalVarRetriesLastStatus] = lastRetryStatus | ||
| localParams[common.LocalVarRetriesLastMessage] = lastRetryMessage | ||
|
|
There was a problem hiding this comment.
we could use the output from buildRetryStrategyLocalScope,
and add them in localParams
| // Inject lastRetry variables | ||
| // the first node will not have "lastRetry" variables so they must have default values | ||
| // for the expression to resolve |
|
This PR seems to have stalled - would love to be able to use these vars, what needs to happen to get it moving again? |
|
this was done more than a year ago. I would need to review everything which will take time. If anyone wants to jump in and contribute the requested changes I'm ok with that. |
|
resurrected the PR here: #14450 |
|
Thank you for contributing this, @eduardodbr ! Isitha picked it up and rounded it out to merge the feature in #14450 and it's released in v3.7, so we'll close this PR out. cc @gdhagger and @EladProject for visibility. |
Fixes #10364
Motivation
Modifications
Verification
uses the exit code to know when to increase memory. This should use 10MB,20MB,30MB,40MB,50MB in each iteration