Skip to content
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

Support preDelete lifecycle for Advanced DaemonSet #923

Merged

Conversation

FillZpp
Copy link
Member

@FillZpp FillZpp commented Mar 9, 2022

Signed-off-by: FillZpp FillZpp.pub@gmail.com

Ⅰ. Describe what this PR does

Support preDelete lifecycle for Advanced DaemonSet

Ⅱ. Does this pull request fix one issue?

fixes #911

@kruise-bot kruise-bot added the size/L size/L: 100-499 label Mar 9, 2022
@FillZpp FillZpp force-pushed the support-predelete-lifecycle-hook-for-ads branch from e585438 to c1a1137 Compare March 9, 2022 09:30
Signed-off-by: FillZpp <FillZpp.pub@gmail.com>
@FillZpp FillZpp force-pushed the support-predelete-lifecycle-hook-for-ads branch from c1a1137 to 4b8edbf Compare March 9, 2022 09:57
@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2022

Codecov Report

Merging #923 (4b8edbf) into master (2953c6c) will decrease coverage by 0.08%.
The diff coverage is 23.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #923      +/-   ##
==========================================
- Coverage   49.21%   49.13%   -0.09%     
==========================================
  Files         119      119              
  Lines       11120    11166      +46     
==========================================
+ Hits         5473     5486      +13     
- Misses       4805     4833      +28     
- Partials      842      847       +5     
Flag Coverage Δ
unittests 49.13% <23.71%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/util/inplaceupdate/inplace_update.go 33.54% <0.00%> (-1.08%) ⬇️
...emonset/validating/daemonset_validating_handler.go 41.83% <0.00%> (-1.33%) ⬇️
pkg/controller/daemonset/daemonset_controller.go 42.07% <17.46%> (-2.35%) ⬇️
pkg/controller/daemonset/daemonset_update.go 55.75% <50.00%> (-0.73%) ⬇️
pkg/controller/cloneset/sync/cloneset_update.go 46.48% <100.00%> (+0.29%) ⬆️
pkg/controller/daemonset/daemonset_util.go 57.03% <100.00%> (+0.68%) ⬆️
pkg/controller/cloneset/cloneset_controller.go 52.85% <0.00%> (+2.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2953c6c...4b8edbf. Read the comment docs.

@@ -255,6 +256,7 @@ func (c *realControl) updatePod(cs *appsv1alpha1.CloneSet, coreControl clonesetc
if res.InPlaceUpdate {
if res.UpdateErr == nil {
c.recorder.Eventf(cs, v1.EventTypeNormal, "SuccessfulUpdatePodInPlace", "successfully update pod %s in-place(revision %v)", pod.Name, updateRevision.Name)
clonesetutils.ResourceVersionExpectations.Expect(&metav1.ObjectMeta{UID: pod.UID, ResourceVersion: res.NewResourceVersion})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need UpdateExpectations here ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I will remove it in next PR.

@@ -785,6 +816,9 @@ func (dsc *ReconcileDaemonSet) podsShouldBeOnNode(
// Emit an event so that it's discoverable to users.
dsc.eventRecorder.Eventf(ds, corev1.EventTypeWarning, FailedDaemonPodReason, msg)
podsToDelete = append(podsToDelete, pod.Name)
} else if isPodPreDeleting(pod) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need add PreparingDelete pods into podsToDelete, if there is some logic which make the pods in the podsToDelete in the first place , is it still the case when next reconcile?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we should put it into podsToDelete even if it has been set to PreparingDelete in previous reconcile.

Copy link
Member

@furykerry furykerry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@FillZpp
Copy link
Member Author

FillZpp commented Mar 14, 2022

/approve

@kruise-bot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kruise-bot kruise-bot merged commit d6fb77a into openkruise:master Mar 14, 2022
ppbits pushed a commit to ppbits/kruise that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] support lifecycle in daemonset
4 participants