-
Notifications
You must be signed in to change notification settings - Fork 20
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
Remove SubnetPort/Pod Finalizer #792
Remove SubnetPort/Pod Finalizer #792
Conversation
dceafcc
to
fdc475e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #792 +/- ##
==========================================
- Coverage 49.05% 48.75% -0.31%
==========================================
Files 94 94
Lines 12194 12245 +51
==========================================
- Hits 5982 5970 -12
- Misses 5709 5773 +64
+ Partials 503 502 -1
|
fdc475e
to
80c52aa
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, not related to this PR, just curious about the podIsDeleted
function.
func podIsDeleted(pod *v1.Pod) bool {
return !pod.ObjectMeta.DeletionTimestamp.IsZero() || pod.Status.Phase == "Succeeded" || pod.Status.Phase == "Failed"
}
I think it's because when the pod is in phase Succeeded/Failed, it means the pod will never run again and thus the corresponding subnetport is no longer required. Then we can delete the nsx subnetport. |
Signed-off-by: Yanjun Zhou <[email protected]>
80c52aa
to
9b9bb82
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
/e2e |
This PR removes the Finalizer in SubnetPort and Pod controller to provide a smooth
deletion experience for the user while ensure the stale NSX SubnetPort will be deleted
as expected.
Testing done:
in the log that corresponding NSX SubnetPort will be deleted by the controller
when a delete event is detected.
lifecycle-controller/system.vmware.com finalizer on the pod. But the log shows the
corresponding NSX SubnetPort will be deleted by the controller when a delete event
is detected.