-
Notifications
You must be signed in to change notification settings - Fork 40k
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 deployment e2e flake: Update DeploymentReaper.Stop to use ObservedGeneration #21857
Conversation
Labelling this PR as size/M |
GCE e2e build/test failed for commit 2f66087cff6b40805bedde7162c53b523b6eb487. |
2f66087
to
54476dd
Compare
GCE e2e build/test failed for commit 54476ddaa5f0291b26b92710f879004ec645cc37. |
// https://github.com/kubernetes/kubernetes/issues/20966 | ||
// Instead deployment should be Paused at this point and not at next TODO. | ||
d.Spec.Paused = false | ||
d.Spec.Paused = true |
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.
If Paused is set, then Replicas and RevisionHistoryLimit won't be acted upon.
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.
Doesn't matter much, I suppose.
Tests failed. |
Yes
|
ah we are not even updating ObservedGeneration for a paused deployment :) |
PR needs rebase |
Yes, we really need pause to just halt rollout progress. See #20273. |
bde1332
to
9b6b3f8
Compare
GCE e2e build/test failed for commit bde1332ef34bf6ff55c638b4f8b68387647eefb7. |
Rebased and added another commit to update status for paused deployments. |
Labelling this PR as size/L |
@@ -420,9 +420,11 @@ func (dc *DeploymentController) syncDeployment(key string) error { | |||
d := *obj.(*extensions.Deployment) | |||
|
|||
if d.Spec.Paused { | |||
// Dont take any action for paused deployment. |
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.
Put a TODO here to implement scaling: #20273
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.
Done
GCE e2e test build/test passed for commit 9b6b3f80661d90e909b6eff56476755389887288. |
9b6b3f8
to
9d72599
Compare
Updated code as per comments. |
GCE e2e test build/test passed for commit 9d72599. |
Fixes #20966 @nikhiljindal two comments from my side: one big related to the order of removing Deployment before removing RS and the other one regarding missing test case for paused deployments. |
"paused deployment should be ignored by the controller" is now failing continuously due to timeout since observedGeneration is not set. We should try to get this in ASAP. |
@soltysh has a good point about deleting the Deployment last, so the user can access the Deployment in the case that there's an error in an earlier step. I forgot about that. We need to add a comment, and should document that as a kubectl convention. @nikhiljindal Please move the delete back to the end, sorry. |
Pushed another commit to move deployment delete back at the end. |
Re: a test case for paused deployment, we already have a testPausedDeployment() in test/e2e/deployment.go. |
GCE e2e test build/test passed for commit 2a538e3. |
return err | ||
} | ||
allRSs := append(controller.FilterActiveReplicaSets(oldRSs), newRS) | ||
|
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.
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.
Or we can have it as a follow-up. If so, I will split it from my PR, once this merges.
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.
Good point, but let's do that as a followup.
LGTM |
Merging to (hopefully) fix flakes. |
fix deployment e2e flake: Update DeploymentReaper.Stop to use ObservedGeneration
Personally I prefer having unit test for every functionality, these are the only ones I run frequently when working on a piece of code. e2e are great, but I usually run them at the end of dev process. So if you don't mind I'd rather have some unit tests to cover the code. Since this is already merged a followup would be nice :) |
Removing race condition in DeploymentReaper.Stop() by waiting for the ObservedGeneration to be updated.
Support for ObservedGeneration for deployments was added in #21754
Fixes #21753 and #21798
cc @bgrant0607 @janetkuo @Kargakis @mqliang @ironcladlou @soltysh