-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Add MinReadySeconds to rolling updater #28111
Conversation
GCE e2e build/test failed for commit b25f4a49ac40eb91aeb036fbdf07a3f8b2b2aa99. Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake. |
b25f4a4
to
c3ee0eb
Compare
GCE e2e build/test failed for commit c3ee0ebc2bb13255b7a7c195e2e27505e5eac91b. Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake. |
@kubernetes/kubectl |
if !api.IsPodReady(&pod) { | ||
continue | ||
} | ||
// Compute the time where the Pod should be ready, adding the MinReadySeconds. |
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.
s/where/when/
Needs a unit test. |
Is the plan to expose this for deployments with an annotation, or something else? |
Are you talking about the Deployment object or |
c3ee0eb
to
124f990
Compare
@Kargakis test added |
124f990
to
6b34073
Compare
6b34073
to
39782fa
Compare
GCE e2e build/test failed for commit 124f9905b93ab9373cc5591d4e43bc0351d34a1f. Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake. |
GCE e2e build/test passed for commit 6b340733fbe53c99dd689df3e2761c11423aeabb. |
GCE e2e build/test passed for commit 39782fabd0232291b7324cd439f1ed34dfabad5c. |
@Kargakis done. |
case newRc.Name: | ||
newReady++ | ||
} | ||
if r.nowFn != nil && !deployment.IsPodAvailable(&pod, minReadySeconds, r.nowFn().Time) { |
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 nowFn is nil default to Now(). Otherwise, you will consider every pod as ready, right?
if r.nowFn == nil {
r.nowFn = unversioned.Now()
}
if !deployment.IsPodAvailable(&pod, minReadySeconds, r.nowFn().Time) {
continue
}
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.
@Kargakis ready in no time :-)
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.
@Kargakis the nowFn is defaulted in initializer:
updater.nowFn = func() unversioned.Time { return unversioned.Now() }
but yes, in case you don't use initializer, we should default there (tests)
GCE e2e build/test passed for commit 8f395e8eb020f54c6c67aaa96140d23135b3f9d9. |
Status: status, | ||
Type: api.PodReady, | ||
Status: status, | ||
LastTransitionTime: now, |
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.
Have this time being fixed and pass two different times (so you will need two different test cases below) - one that is after this time and one that is before.
b783c17
to
464d136
Compare
GCE e2e build/test passed for commit b783c17f972b284fd387da1f6bc5c05e6761fbc1. |
oldReady, newReady int32 | ||
err error | ||
) | ||
oldReady, newReady, err = updater.readyPods(test.oldRc, test.newRc, test.minReadySeconds) |
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.
oldReady, newReady, err :=
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.
The point of initializing was to remove the variables above too:)
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.
ETOOMUCHMULTITASKING
464d136
to
2921784
Compare
GCE e2e build/test passed for commit 464d136005a367bc576f4d204388c2c03270f4f9. |
One more comment, then LGTM |
2921784
to
7ea28e4
Compare
GCE e2e build/test passed for commit 2921784e9c8766196265bf5e6c44a0c5a9522bf4. |
GCE e2e build/test passed for commit 7ea28e4. |
GCE e2e build/test passed for commit 7ea28e4. |
@k8s-bot test this issue: #IGNORE |
GCE e2e build/test passed for commit 7ea28e4. |
@k8s-bot test this issue: #IGNORE (jenkins plugin crash) |
GCE e2e build/test passed for commit 7ea28e4. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 7ea28e4. |
Automatic merge from submit-queue |
Automatic merge from submit-queue Document space shuttle style in controller/volume Reverts #28813 and #28111. @xiang90, I really appreciate the effort that went into your PRs (and think, in general, code simplification is a worthwhile effort), but the style in this controller was intentional to ensure that every branch is covered. The verbosity and branchyness of this controller stores a lot of context and knowledge about how this subsystem is meant to function, so we need to put them back in. @kubernetes/sig-storage cc @jsafrane @saad-ali @matchstick @thockin @childsb @rootfs
Add MinReadySeconds support to RollingUpdater that allows to specify the number of seconds to wait on top of the pod is "ready" because its readiness probe passed.