-
Notifications
You must be signed in to change notification settings - Fork 805
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
Implement StatusCheck in Workflow #3067
Conversation
Signed-off-by: SiyuChen <ryougi201@gmail.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: SiyuChen <ryougi201@gmail.com>
…rkflow Signed-off-by: SiyuChen <ryougi201@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #3067 +/- ##
==========================================
- Coverage 37.10% 36.42% -0.68%
==========================================
Files 106 109 +3
Lines 9634 10044 +410
==========================================
+ Hits 3575 3659 +84
- Misses 5736 6052 +316
- Partials 323 333 +10
Continue to review full report at Codecov.
|
// Reconcile watches `WorkflowNodes`, if: | ||
// 1. the abort condition is `False`, just return. | ||
// 2. the abort condition is `True`, the node is not `TypeStatusCheck`, it will propagate abort condition to children nodes. | ||
// 3. the abort condition is `True`, the node is `TypeStatusCheck`, it will add abort annotation to the parent workflow. |
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.
Does the StatusCheck
's parent continue to add abort annotation to its parent?
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.
No, the abort 'flow' is top-down, only the parent node will abort the children nodes.
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.
So I add another reconciler (AbortWorkflowReconciler), it will set the abort condition of the entry node
to True
.
Signed-off-by: SiyuChen <ryougi201@gmail.com>
Signed-off-by: SiyuChen <ryougi201@gmail.com>
for _, item := range statusChecks[1:] { | ||
statusCheckToRemove = append(statusCheckToRemove, item.GetName()) | ||
} | ||
it.logger.Info("removing duplicated StatusCheck", |
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.
why exist some duplicate status checks?
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.
It's the same reason with #3112 🤣.
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.
maybe we can update duplicated
to redundant
later
Signed-off-by: SiyuChen <ryougi201@gmail.com>
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.
IMO, the abort
should recover all the injected chaos. How do you think about it ?
api/v1alpha1/workflow_types.go
Outdated
// Abort describe whether to abort the workflow when the failure threshold of StatusCheck is exceeded. Only used when Type is TypeStatusCheck. | ||
// +optional | ||
Abort bool `json:"abort,omitempty"` |
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.
// Abort describe whether to abort the workflow when the failure threshold of StatusCheck is exceeded. Only used when Type is TypeStatusCheck. | |
// +optional | |
Abort bool `json:"abort,omitempty"` | |
// Abort describe whether to abort the workflow when the failure threshold of StatusCheck is exceeded. Only used when Type is TypeStatusCheck. | |
// +optional | |
AbortWithStatusCheck bool `json:"abortWithStatusCheck,omitempty"` |
I suggest using more words as the name of this field. Only one word in a plain workflow.yaml without these comments might bring confusion.
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.
Updated! PTAL
Sorry, I missed changes on |
Signed-off-by: SiyuChen <ryougi201@gmail.com>
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.
LGTM
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.
LGTM!
/merge |
This pull request has been accepted and is ready to merge. Commit hash: c769b4b
|
Signed-off-by: SiyuChen ryougi201@gmail.com
What problem does this PR solve?
Close #3048
What's changed and how it works?
Related changes
chaos-mesh/website
Dashboard UI
Checklist
Tests
Side effects
Release note
DCO
If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it: