-
Notifications
You must be signed in to change notification settings - Fork 771
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 mark pod not ready feature to Lifecycle hooks #979
Conversation
906d86d
to
e06c854
Compare
// Actually, there is a bug cased by this transformation from PreparingDelete to Normal, | ||
// i.e., Lifecycle Updated Hook may be lost if the pod was transformed from Updating state | ||
// to PreparingDelete. | ||
if cs.Spec.Lifecycle != nil || lifecycle.IsHookRequiredPodNotReady(cs.Spec.Lifecycle.PreDelete) { |
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.
opt.semgrep.bad-nil-guard: Useless nil guard
(at-me in a reply with help
or ignore
)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
e06c854
to
39f9303
Compare
Codecov Report
@@ Coverage Diff @@
## master #979 +/- ##
==========================================
+ Coverage 49.93% 49.95% +0.01%
==========================================
Files 120 121 +1
Lines 11558 11579 +21
==========================================
+ Hits 5772 5784 +12
- Misses 4914 4924 +10
+ Partials 872 871 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
39f9303
to
7a778df
Compare
return &ReconcileContainerRecreateRequest{ | ||
Client: util.NewClientFromManager(mgr, "containerrecreaterequest-controller"), | ||
Client: cli, |
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.
gofmt: File is not gofmt
-ed with -s
(at-me in a reply with help
or ignore
)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
// Interface for managing pods lifecycle. | ||
type Interface interface { | ||
UpdatePodLifecycle(pod *v1.Pod, state appspub.LifecycleStateType) (bool, *v1.Pod, error) | ||
UpdatePodLifecycle(pod *v1.Pod, state appspub.LifecycleStateType, requiredPodNotReady bool) (bool, *v1.Pod, error) | ||
UpdatePodLifecycleWithHandler(pod *v1.Pod, state appspub.LifecycleStateType, inPlaceUpdateHandler *appspub.LifecycleHook) (bool, *v1.Pod, error) | ||
} | ||
|
||
type realControl struct { | ||
adp podadapter.Adapter |
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.
gofmt: File is not gofmt
-ed with -s
(at-me in a reply with help
or ignore
)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
// Actually, there is a bug cased by this transformation from PreparingDelete to Normal, | ||
// i.e., Lifecycle Updated Hook may be lost if the pod was transformed from Updating state | ||
// to PreparingDelete. | ||
if cs.Spec.Lifecycle != nil && ( |
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.
gofmt: File is not gofmt
-ed with -s
(at-me in a reply with help
or ignore
)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
7a778df
to
7f9b557
Compare
@@ -755,7 +755,8 @@ func (dsc *ReconcileDaemonSet) syncWithPreparingDelete(ds *appsv1alpha1.DaemonSe | |||
podsCanDelete = append(podsCanDelete, podName) | |||
continue | |||
} | |||
if updated, gotPod, err := dsc.lifecycleControl.UpdatePodLifecycle(pod, appspub.LifecycleStatePreparingDelete); err != nil { | |||
requiredPodNotReady := ds.Spec.Lifecycle.PreDelete.MarkPodNotReady |
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 we rename all requiredPodNotReady variables/comments to markPodNotReady
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
c57492b
to
3b67a4f
Compare
/lgtm |
3b67a4f
to
f959515
Compare
Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
f959515
to
8fa6413
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FillZpp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com> Co-authored-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com> Signed-off-by: Liu Zhenwei <zwliu@thoughtworks.com>
Co-authored-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
Signed-off-by: mingzhou.swx mingzhou.swx@alibaba-inc.com
Ⅰ. Describe what this PR does
Ⅱ. Does this pull request fix one issue?
#944