Refactor PVC event propagation for populators#4137
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/retest |
update logic to prioritize bound condition msg from prime pvc if one exists. update function name to reflect this behavior change no longer set conditions for prime pvc as well, only the target pvc needs to be updated in order for events to get propogated to the DV. extract out event parsing logic to new getLatestEventMessage helper func. Signed-off-by: dsanatar <dsanatar@redhat.com> Assisted-by: Claude <noreply@anthropic.com>
|
PR needs rebase. DetailsInstructions 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-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@dsanatar: The following tests failed, say
DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
What this PR does / why we need it:
UpdatePVCBoundContionFromEventswas originally implemented to assist with propagating events from a prime PVC to the target DV so that if something went wrong in the prime PVC, a user could check the DV resource and it's bound condition message would display the latest event message. Unbound DV's already inherit the bound condition message from the associated PVC, so the intent of this function was to get the latest event messages from a prime PVC and set it as the bound condition of the target PVC so that it could be later read by the DV.However, this function over-complicates this process by also allowing prime PVCs to update their bound condition message to their own latest event message. All that is needed for this propagation is for events from prime PVCs to get copied to the target PVCs (already implemented as apart of #3764) and then only the target PVC needs their bound condition updated for it to appear in the DV. Allowing prime PVCs through this update flow introduced unnecessary Patch calls and more potential for race conditions with no real benefit.
The main motivation for this refactor is also to allow certain cases when the prime PVC's bound condition is explicitly set by a separate component, such as here when a VDDK config map is missing from a cluster. This should take priority over events and should be reported back up to the DV instead of the events.
containerized-data-importer/pkg/controller/import-controller.go
Lines 555 to 560 in 5e5bce6
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes https://redhat.atlassian.net/browse/CNV-57727
Special notes for your reviewer:
Release note: