-
Notifications
You must be signed in to change notification settings - Fork 63
Remove PV of OVA provider server #742
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
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #742 +/- ##
=========================================
+ Coverage 0 19.18% +19.18%
=========================================
Files 0 80 +80
Lines 0 15707 +15707
=========================================
+ Hits 0 3013 +3013
- Misses 0 12456 +12456
- Partials 0 238 +238
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Why? and what can be done to do it on the creation? if possible.. i saw that we already set |
setting |
The way the PV for a pod that serves as an NFS server for an OVA provider is created doesn't allow its deletion by a CSI driver and therefore we need to take care of its cleanup when the OVA provider is deleted. Here, we add a finalizer to OVA providers to prevent their deletion until we delete their PV. Signed-off-by: Arik Hadas <ahadas@redhat.com>
|
@@ -234,6 +236,30 @@ func (r Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (r | |||
} | |||
} | |||
|
|||
if provider.DeletionTimestamp != nil && k8sutil.ContainsFinalizer(provider, api.OvaProviderFinalizer) { |
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.
I remembered another issue I had when looking into it, once the provider deleted the objects was no longer accessible, were you able to query its fields at this point?
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, note that with a finalizer, an entity doesn't get removed until the finalizer is dropped - so when we get here, the provider still exists and has the DeletionTimestamp field set (that's the "update" we get), so we can still get its properties
if specChanged { | ||
patches := mutator.patchPayload() | ||
patches = append(patches, util.PatchOperation{ |
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.
not improtant but we can probably also use jsonpatch.CreateMergePatch
The way the PV for a pod that serves as an NFS server for an OVA provider is created doesn't allow its deletion by a CSI driver and therefore we need to take care of its cleanup when the OVA provider is deleted.
Here, we add a finalizer to OVA providers to prevent their deletion until we delete their PV.