-
Notifications
You must be signed in to change notification settings - Fork 880
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: avoid invalid replica in workloadRef #1304
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1304 +/- ##
=======================================
Coverage 81.41% 81.41%
=======================================
Files 106 106
Lines 9702 9702
=======================================
Hits 7899 7899
Misses 1266 1266
Partials 537 537
Continue to review full report at Codecov.
|
63b2fa0
to
23a621d
Compare
- defaulting replica after workload ref is resolved Signed-off-by: Hui Kang <[email protected]>
23a621d
to
1c063ea
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@huikang I'm having trouble understanding how moving the defaulting of spec.replicas fixes the problem and why the problem only happens if there is an analysis in the steps. Could you explain how this fixes it? |
Sure thing. In the original implementation, if the rollout refers to a deployment and does not have replica set, it will call the update method before resolving the template. Since the template is empty, i.e., no container in the struct), update will return error. argo-rollouts/rollout/controller.go Lines 367 to 368 in e1840b5
This PR changes the order of update() and resolve() such that update can return successfully with defaulted replica. |
This is what was surprising to me. I didn't think the Update() would fail in that manner. In any case I see this fixes the issue. Thanks! |
Signed-off-by: Hui Kang <[email protected]>
Signed-off-by: Hui Kang [email protected]
close #1302
Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.