Check for PVC label selector conflicts against the secondary cluster - cherrypick PR#1855 #2021
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.
Applying PVC Label Conflict Check on the Secondary Cluster
The PR introduces a mechanism in vrg_volrep.go and vrg_volsync.go that applies the PVCLabelSelector from the secondary VRG and checks whether any PVCs are selected.
Expected behavior:
A secondary VRG should not match any PVCs using the PVCLabelSelector.
If a PVC is selected on the secondary cluster, it indicates a conflict because the label selector should not apply to unintended PVCs after failover/relocation.
In case of a conflict, the reconciliation process will be required, and the VRG will log the issue.
For VolSync, the behavior is slightly different, if the label selector matches any PVC that is not part of RDSpec, it is considered a conflict.
Fix for : #1861
Fix for : #2022