-
Notifications
You must be signed in to change notification settings - Fork 904
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
fix: continue update process in middle of update if spec.replicas is 0 #1764
fix: continue update process in middle of update if spec.replicas is 0 #1764
Conversation
5d8eb22
to
e91436e
Compare
Codecov Report
@@ Coverage Diff @@
## master #1764 +/- ##
==========================================
+ Coverage 82.03% 82.05% +0.01%
==========================================
Files 116 116
Lines 16175 16219 +44
==========================================
+ Hits 13269 13308 +39
- Misses 2227 2231 +4
- Partials 679 680 +1
Continue to review full report at Codecov.
|
- if canary.spec.replicas==0 as in the canary steps, update continues Signed-off-by: Hui Kang <[email protected]>
e91436e
to
abc8029
Compare
thanks for fixing the issue. @huikang |
utils/replicaset/replicaset.go
Outdated
@@ -630,5 +630,5 @@ func IsReplicaSetReady(rs *appsv1.ReplicaSet) bool { | |||
} | |||
replicas := rs.Spec.Replicas | |||
readyReplicas := rs.Status.ReadyReplicas | |||
return replicas != nil && *replicas != 0 && readyReplicas != 0 && *replicas <= readyReplicas | |||
return (replicas != nil && *replicas != 0 && readyReplicas != 0 && *replicas <= readyReplicas) || (replicas != nil && *replicas == 0) |
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.
can you update description to the function with added condition
utils/replicaset/replicaset.go
Outdated
@@ -630,5 +630,5 @@ func IsReplicaSetReady(rs *appsv1.ReplicaSet) bool { | |||
} | |||
replicas := rs.Spec.Replicas | |||
readyReplicas := rs.Status.ReadyReplicas | |||
return replicas != nil && *replicas != 0 && readyReplicas != 0 && *replicas <= readyReplicas | |||
return (replicas != nil && *replicas != 0 && readyReplicas != 0 && *replicas <= readyReplicas) || (replicas != nil && *replicas == 0) |
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.
can you please add the given scenario as an e2e test?
040f91f
to
d0c2d2a
Compare
… intermediate replicaset Signed-off-by: Hui Kang <[email protected]>
d0c2d2a
to
4d1e68d
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Great job! |
Signed-off-by: Hui Kang [email protected]
fix #1690
Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.