-
Notifications
You must be signed in to change notification settings - Fork 55
Fix: Updates the addon-operation WFS to newer image and corrects wait… #210
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
base: main
Are you sure you want to change the base?
Fix: Updates the addon-operation WFS to newer image and corrects wait… #210
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 reviewable
to ensure this PR is ready for review.Addedbackport release-x.y
labels 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