-
#9937 asked for (and #10987 delivered) the workflow result status message to be exposed for conditional retry expressions to use. The example in #9937 seems to be the only documentation on how to use it. I've tried to use it like so: retryStrategy:
limit: "10"
expression: "lastRetry.message.contains('imminent node shutdown') || lastRetry.message.contains('pod deleted')" but was given this error:
Am I not using this correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Apparently the syntax above (from #9937) is invalid, but this works: retryStrategy:
limit: "10"
expression: >-
lastRetry.message contains 'imminent node shutdown' || lastRetry.message contains 'pod deleted' |
Beta Was this translation helpful? Give feedback.
-
Hi @chabala! The expression given in
retryStrategy:
limit: "10"
expression: lastRetry.message matches 'imminent node shutdown|pod deleted' |
Beta Was this translation helpful? Give feedback.
Hi @chabala! The expression given in
retryStrategy.expression
is evaluated usingexpr
: https://expr-lang.org/docs/language-definitionexpr
evaluateslastRetry.message.contains(...)
by checking for acontains()
function on the string type, which doesn't exist. As you discovered, thecontains
operator will do what you want, and you could simplify it a bit using thematches
operator: