-
Notifications
You must be signed in to change notification settings - Fork 777
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
the CloneSet pod lifecycle can be transformed to Normal only if ContainerReady is true #1489
the CloneSet pod lifecycle can be transformed to Normal only if ContainerReady is true #1489
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @chenpeicheng9! It looks like this is your first PR to openkruise/kruise 🎉 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1489 +/- ##
==========================================
+ Coverage 48.40% 48.54% +0.13%
==========================================
Files 157 157
Lines 22440 22485 +45
==========================================
+ Hits 10862 10915 +53
+ Misses 10387 10364 -23
- Partials 1191 1206 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
if cs.Spec.Lifecycle != nil && !lifecycle.IsPodAllHooked(cs.Spec.Lifecycle.InPlaceUpdate, pod) { | ||
state = appspub.LifecycleStateUpdated | ||
} else { | ||
if util.IsRunningAndContainerReady(pod) && lifecycle.IsInPlaceUpdateHookNilOrAllHooked(cs.Spec.Lifecycle, pod) { |
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.
For now, just consider determining if it's ready from preNormal to normal. It is not recommended to consider from update to normal.
@chenpeicheng9 Can you communicate through dingding? |
sure |
plz squash and sign the commits |
…nly if ContainerReady is true(openkruise#1485)
5b12ff5
to
924e7a6
Compare
As discussed, for now, I have removed the update-to-normal part. And made slight modifications to the comments. @zmberg. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Ⅰ. Describe what this PR does
The CloneSet pod lifecycle can be transformed to Normal only if ContainerReady is true.
Sorry for being late.
Last week After I created issue #1485, I appreciate that the Kruise team replied quickly and pointed out that it may be better "to Normal after Pod Ready" @zmberg
I've been thinking about this issue these days. I believe using the 'PodReady'(k8s.io/api/core/v1.PodReady, 'Ready' in yaml, same as below) condition may not be appropriate. Consider the scenario with the 'markPodNotReady' set: the Pod's lifecycle can only be transformed to 'Normal' if 'PodReady' is true. On the other hand, the 'PodReady' condition will be set to false at preparingDelete/preparingUpdate state. This bidirectional influence adds complexity and can make the lifecycle confusing.
So I suggest that we can use the "ContainerReady" condition, it would be simple enough.
A pod's lifecycle will be transformed from PreparingNormal to Normal only if its containers are all ready.
Furthermore, it is ok that a pod's lifecycle will be transformed to Normal only if its containers are all ready.
Ⅱ. Does this pull request fix one issue?
fixes #1485
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews