Fix: Updates the addon-operation WFS to newer image and corrects wait…#210
Fix: Updates the addon-operation WFS to newer image and corrects wait…#210briankane wants to merge 1 commit intokubevela:mainfrom
Conversation
There was a problem hiding this comment.
cubic reviewed this PR and found no issues. Review PR in cubic.dev.
9dae36f to
7029070
Compare
charts/vela-workflow/templates/definitions/addon-operation.yaml
Outdated
Show resolved
Hide resolved
7029070 to
56e0ac6
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
===========================================
- Coverage 62.49% 20.32% -42.17%
===========================================
Files 62 59 -3
Lines 4415 5637 +1222
===========================================
- Hits 2759 1146 -1613
- Misses 1324 4316 +2992
+ Partials 332 175 -157
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… logic Signed-off-by: Brian Kane <briankane1@gmail.com>
56e0ac6 to
2b844bb
Compare
|
|
||
| wait: op.#ConditionalWait & { | ||
| continue: job.value.status.succeeded != _|_ && job.value.status.succeeded > 0 | ||
| continue: job.value.status.succeeded != _|_ || job.value.status.failed != _|_ |
There was a problem hiding this comment.
In a workflow with several steps, turning on continue on fail lets the next steps start even if the current step hasn’t finished or succeeded yet. This way, the workflow doesn’t wait for all retry attempts to be used up before moving on.
There was a problem hiding this comment.
I ended up using the new providers with if statements to check the status.succeeded is set. This snippet working for me.
import (
"strings"
"vela/builtin"
"vela/kube"
"vela/util"
)
....
job: op.#Apply & {
$params: value: {
....
}
log: util.#Log & {
$params: source: {
resources: [{labelSelector: {
"workflow.oam.dev/name": context.name
"workflow.oam.dev/session": context.stepSessionID
}}]
}
}
fail: builtin.#Steps & {
if job.$returns.value.status.failed != _|_ {
if job.$returns.value.status.failed > 2 {
breakWorkflow: builtin.#Fail & {
$params: message: "addon operation failed"
}
}
}
wait: builtin.#ConditionalWait & {
if job.$returns.value.status.succeeded != _|_ {
if job.$returns.value.status.succeeded > 0 {
$params: continue: true
}
}
}
… logic
Description of your changes
Fixes #
I have:
make reviewableto ensure this PR is ready for review.Addedbackport release-x.ylabels to auto-backport this PR if necessary.How has this code been tested
Special notes for your reviewer
N/A
Summary by cubic
Updated the addon-operation workflow step to use the latest image and fixed the wait logic so job status is reported correctly.
Bug Fixes
Dependencies