-
Notifications
You must be signed in to change notification settings - Fork 292
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 handling for orphaned VSphereMachines #2429
🌱 Remove handling for orphaned VSphereMachines #2429
Conversation
93511ad
to
c242fe5
Compare
c242fe5
to
004b849
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2429 +/- ##
=======================================
Coverage ? 63.93%
=======================================
Files ? 123
Lines ? 8731
Branches ? 0
=======================================
Hits ? 5582
Misses ? 2741
Partials ? 408
☔ View full report in Codecov by Sentry. |
/retest |
/lgtm /assign @chrischdi @killianmuldoon Would it be possible to test this once manually or with the clusterctl upgrade test? (Just to get some additional confidence) |
LGTM label has been added. Git tree hash: 547100069e49269d72c4bd3262499a6ddcd8b4bf
|
@@ -158,12 +154,6 @@ func (r *clusterReconciler) reconcileDelete(ctx context.Context, clusterCtx *cap | |||
log := log.WithValues("VSphereMachine", klog.KObj(vsphereMachine)) | |||
ctx := ctrl.LoggerInto(ctx, log) | |||
|
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.
Missed this before. Shouldn't we be able to drop the entire finalizer handling here?
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.
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.
You're right - we can get rid of the entire block that deals with deleting Machines here.
cc @srm09 |
/hold Will test this manually |
WDYT about #2429 (comment)? |
004b849
to
959691c
Compare
/test |
@killianmuldoon: The
The following commands are available to trigger optional jobs:
Use
In response to this:
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. |
LGTM label has been added. Git tree hash: 9b2b2e4f1ef12d07edfb17895569cc981a719577
|
Yeah - exactly we should consider this directly a part of the ownerReferences fixes. |
Sounds great! /approve There's a still a hold on it :-) |
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.
one left nit
/approve cancel
// If the VSphereCluster has been previously set as an ownerReference remove it. This may have been set in an older | ||
// version of CAPV to prevent VSphereMachines from being orphaned, but is no longer needed. | ||
// For more info see: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/issues/2054 | ||
// TODO (killianmuldoon): Decide when this can be removed. |
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.
Should we remove this comment or code? :-)
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.
This was meant to be a bit longer term - i.e. this is migration code and eventually when all existing Clusters have passed through this migration we shouldn't need it any more. I've updated this to be a bit clearer, without asserting when it should be removed.
machineDeletionCount++ | ||
// Remove the finalizer since VM creation wouldn't proceed | ||
log.Info("Removing finalizer from VSphereMachine") | ||
ctrlutil.RemoveFinalizer(vsphereMachine, infrav1.MachineFinalizer) |
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.
Don't we still need something which removes this finalizer? Or should this already have happened a longer time ago?
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.
You're right - let me put this on [WIP] - I'm still trying to test it properly.
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.
This finalizer is going to be removed in the vspheremachine_controller at
cluster-api-provider-vsphere/controllers/vspheremachine_controller.go
Lines 285 to 289 in 959691c
if apierrors.IsNotFound(err) { | |
// The VM is deleted so remove the finalizer. | |
ctrlutil.RemoveFinalizer(machineCtx.GetVSphereMachine(), infrav1.MachineFinalizer) | |
return reconcile.Result{}, nil | |
} |
Previously the VSphereCluster was able to do a full cleanup in case VSphereMachines were orphaned. They shouldn't be able to become orphaned now as CAPI ensure InfrastructureMachines should always have an ownerReference.
959691c
to
f4c6b2d
Compare
One comment on this - contradicting what I said above 😅 The migration here is independent from the owner reference migration in v1.8.2 as it doesn't deal with versions. In this case we should keep the owner reference migration code - which removes the |
One final comment |
Signed-off-by: killianmuldoon <[email protected]>
f4c6b2d
to
c82f792
Compare
/retest |
Thx! /lgtm Feel free to hold cancel |
LGTM label has been added. Git tree hash: c049b412588caf3dacf7f3350536139e7aec5bc1
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer 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 |
/hold cancel |
Remove special handling for orphaned VSphereMachines. VSphereMachines should no longer be orphaned by CAPI MachineSets on creation so this safeguard is no longer needed.
Fixes #2054