-
Notifications
You must be signed in to change notification settings - Fork 873
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
feat: ability to abort an update when exceeding progressDeadlineSeconds #1397
Conversation
90213e4
to
a17b4e4
Compare
Codecov Report
@@ Coverage Diff @@
## master #1397 +/- ##
==========================================
+ Coverage 81.36% 81.45% +0.08%
==========================================
Files 108 108
Lines 10037 10051 +14
==========================================
+ Hits 8167 8187 +20
+ Misses 1313 1303 -10
- Partials 557 561 +4
Continue to review full report at Codecov.
|
d7dd76f
to
e274da7
Compare
rollout/sync.go
Outdated
condition = conditions.NewRolloutCondition(v1alpha1.RolloutPaused, corev1.ConditionTrue, conditions.TimedOutReason, msg) | ||
} else { | ||
condition = conditions.NewRolloutCondition(v1alpha1.RolloutProgressing, corev1.ConditionFalse, conditions.TimedOutReason, msg) |
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 don't think it's correct to conditionally add the Progressing=False. If we get to line 652 case block, we should always set Progressing to be false.
-
It doesnt look like we will emit an event about the abort, like we do in line 607. Can we structure the code such that if we abort here, we also emit the K8s event about the abort?
-
The setting of the condition
condition = conditions.NewRolloutCondition(v1alpha1.RolloutPaused, corev1.ConditionTrue, conditions.TimedOutReason, msg)
seems incorrect. Why would we be considered paused?
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.
Thanks. I was mistaken about the Paused and Progressing state. Please checkout the updated PR.
- Add AbortExceedProgressDeadline to rollout spec - when rollout doesn't use analysis, set AbortExceedProgressDeadline to true to scale down the new RS. - e2e test added Signed-off-by: Hui Kang <hui.kang@salesforce.com>
Signed-off-by: Hui Kang <hui.kang@salesforce.com>
e274da7
to
6114831
Compare
Signed-off-by: Hui Kang <hui.kang@salesforce.com>
6114831
to
bc25d10
Compare
rollout/sync.go
Outdated
// When ProgressDeadlineAbort is set, abort the update | ||
if c.rollout.Spec.ProgressDeadlineAbort { | ||
c.pauseContext.AddAbort(msg) | ||
c.recorder.Warnf(c.rollout, record.EventOptions{EventReason: conditions.RolloutAbortedReason}, msg) |
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 think this will cause the Abort event to get emitted every reconciliation. We need to only have it emit the Abort event when there is a state change. I think this needs to be moved lower to the SetRolloutCondition
and predicated by if we changed the condition, and c.rollout.Spec.ProgressDeadlineAbort, then we emit the event.
if conditions.SetRolloutCondition(&newStatus, *condition) && c.rollout.Spec.ProgressDeadlineAbort {
c.recorder.Warnf(c.rollout, record.EventOptions{EventReason: conditions.RolloutAbortedReason}, msg)
}
Signed-off-by: Hui Kang <hui.kang@salesforce.com>
So I have a question, maybe I am misunderstanding the changes/docs in this PR. Would this change allow us to abort an update even if we are using analysisTemplate? |
Yes, using this flag the rollout will now abort if either one of these conditions become true:
The second condition is turned on or off with |
Co-authored-by: Kyle Cronin <cronik@users.noreply.github.com> Signed-off-by: Hui Kang <hui.kang@salesforce.com>
be39b65
to
fd8df42
Compare
@huikang the logic looks good, but could you cover the new code with unit tests? |
Hi, @jessesuen , sure, will add a new test case. |
Signed-off-by: Hui Kang <hui.kang@salesforce.com>
5d4a5c8
to
4e4484b
Compare
Signed-off-by: Hui Kang <hui.kang@salesforce.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Hi, @jessesuen , the unit tests have been added. Please take another look. Thanks. |
Great work! |
to true to scale down the new RS.
Signed-off-by: Hui Kang hui.kang@salesforce.com
close #1376
Partial fix: #1295
Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.