-
Notifications
You must be signed in to change notification settings - Fork 37
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
OVA: manually remove PVs attached to ova provider once it deleted. #679
Conversation
Signed-off-by: Bella Khizgiyaev <bkhizgiy@redhat.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@@ -157,6 +160,28 @@ func (r Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (r | |||
_ = r.DB().Close(true) | |||
} | |||
} | |||
|
|||
// Wait for the PV to release |
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.
we should try to avoid placing provider-specific logic here in general and particularly when we add 5 seconds sleep that applies only to the OVA provider
it's not that great either, but it still seems better, to place this code in the Shutdown function of the OVA provider, WDYT?
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.
yeah I think I mention it in one of our talks that its not the best place since its effect all the providers, i"ll try to move it directly under the ova instead.
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.
Another approach that is worth checking is to use a finalizer for the PVC that would remove the PV
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.
Currently I'm encounter some issues with using the finalizer ,especially watching the PVC to catch the delete operation, so I'm putting this aside for now and switching back to the virt-v2v taks, I"ll come bake to it later (I think is the least urgent task from the existing ones).
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.
looking at this thread a bit more carefully, the finalizer should indeed not be placed on the PVC but on the provider - so when the provider is deleted, we'll try to remove its PV and only when the PV is removed, the finalizer is removed and the deletion of the provider can proceed
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.
looking at this thread a bit more carefully, the finalizer should indeed not be placed on the PVC but on the provider - so when the provider is deleted, we'll try to remove its PV and only when the PV is removed, the finalizer is removed and the deletion of the provider can proceed
closing in favor of #742 |
When deleting an OVA provider, the PVs are not automatically deleted. To overcome this issue, as part of the reconciler, we need to perform a manual clean-up. Since the provider is already deleted, we can't query the specific PV by name, so using the PV prefix and labels, we find the matching one. And if the status of it is 'released' (which indicates that the provider was deleted), we remove it from the system.