-
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
trigger endpoint update on pod deletion #54828
trigger endpoint update on pod deletion #54828
Conversation
Good catch! /assign |
This is a good change. I'd like to see a unit test so that we protect against future regressions. Something like this, perhaps: diff --git a/pkg/controller/endpoint/endpoints_controller_test.go b/pkg/controller/endpoint/endpoints_controller_test.go
--- a/pkg/controller/endpoint/endpoints_controller_test.go
+++ b/pkg/controller/endpoint/endpoints_controller_test.go
@@ -1039,6 +1039,13 @@ func TestPodChanged(t *testing.T) {
t.Errorf("Expected pod to be changed with pod readiness change")
}
oldPod.Status.Conditions = saveConditions
+
+ now := metav1.NewTime(time.Now().UTC())
+ newPod.ObjectMeta.DeletionTimestamp = &now
+ if !podChanged(oldPod, newPod) {
+ t.Errorf("Expected pod to be changed with DeletionTimestamp change")
+ }
+ newPod.ObjectMeta.DeletionTimestamp = oldPod.ObjectMeta.DeletionTimestamp.DeepCopy()
}
func TestDetermineNeededServiceUpdates(t *testing.T) { |
Should this be cherry-picked to 1.8? |
@yujuhong yes, it should. @derekwaynecarr or anybody else with rights to do so who happens across this PR, could you please add the cherry-pick-candidate label and the 1.8 milestone? |
544eab5
to
5f4145f
Compare
Added unit test |
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: freehan, joelsmith Assign the PR to them by writing Associated issue: 54723 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@freehan need to add release note for cherrypicks. |
@freehan: Adding do-not-merge/release-note-label-needed because the release note process has not been followed. One of the following labels is required "release-note", "release-note-action-required", or "release-note-none". Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@freehan please add release note or release-note-none label as appropriate. |
Why have the tests still not run? Was the bot asleep when the code was updated? |
/test pull-kubernetes-unit |
/retest Review the full test history for this PR. |
/test pull-kubernetes-e2e-kops-aws |
/retest Review the full test history for this PR. |
Automatic merge from submit-queue (batch tested with PRs 54894, 54630, 54828, 54926, 54865). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Automatic merge from submit-queue (batch tested with PRs 17089, 17120). UPSTREAM: 54828: trigger endpoint update on pod deletion xref kubernetes/kubernetes#54828
Fixes #54723
cc: @joelsmith