OADP-7017: fix DPA error when podConfig has no nodeSelector with load…#2125
Conversation
…Affinity The validator was incorrectly triggering an error whenever podConfig was set (even with only resourceAllocations) alongside nodeAgent.loadAffinity that used matchExpressions. The cross-validation between podConfig and loadAffinityConfig should only run when podConfig.nodeSelector is explicitly set, since that is the only field being compared. Add a guard of len(PodConfig.NodeSelector) > 0 to the outer condition so that a podConfig containing only resourceAllocations (or other non-selector fields) is valid alongside any loadAffinity configuration. Made-with: Cursor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe validation logic in the data protection validator was adjusted to only perform selector consistency checks between Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can generate a title for your PR based on the changes with custom instructions.Set the |
|
@PrasadJoshi12: This pull request references OADP-7017 which is a valid jira issue. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
Verified |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: PrasadJoshi12, sseago The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@PrasadJoshi12: all tests passed! Full PR test history. Your PR dashboard. 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. |
|
@kaovilai please have a look |
The validator was incorrectly triggering an error whenever podConfig was set (even with only resourceAllocations) alongside nodeAgent.loadAffinity that used matchExpressions. The cross-validation between podConfig and loadAffinityConfig should only run when podConfig.nodeSelector is explicitly set, since that is the only field being compared.
Add a guard of len(PodConfig.NodeSelector) > 0 to the outer condition so that a podConfig containing only resourceAllocations (or other non-selector fields) is valid alongside any loadAffinity configuration.
Made-with: Cursor
Why the changes were made
How to test the changes made