Update CnsFileVolumeClient instance even if VM and PVC is deleted, so that finalizer gets removed and eventually instance also gets deleted #3186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
While testing the changes made through #3151, found the following case where CnsFileVolumeClient CR cleanup was not happening:
If CnsFileAccessConfig is marked for deletion (e.g. as part of namespace deletion) and VM got already deleted, then we added a code to fetch VM IP from CnsFileVolumeClient instance and process the deletion of CnsFileAccessConfig. But if PVC is also deleted, then we were skipping the complete code flow to update configureVolumeACL and CnsFileVolumeClient. As a side effect, finaliser was not getting removed and CnsFileVolumeClient instance was remaining in the namespace forever.
Made code changes to just skip configureVolumeACL call if PVC is not found, so that CnsFileVolumeClient gets updated and finaliser is also removed from it and eventually instance gets deleted as expected.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Testing done:
Created couple of file volume PVCs and pods using these PVCs. Later performed namespace deletion operation from VC UI.
namespace deletion succeeded without any error.
Here are syncer logs which confirms that newly added code is fixing the issue:
Special notes for your reviewer:
Release note: