-
Notifications
You must be signed in to change notification settings - Fork 83
Fix OADP-6459: Adding a backupLocation to DPA with an existing backupLocation name is not rejected #1867
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
Fix OADP-6459: Adding a backupLocation to DPA with an existing backupLocation name is not rejected #1867
Conversation
…Lcation name is not rejected
@shubham-pampattiwar: This pull request references OADP-6459 which is a valid jira issue. In 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. |
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.
- Consider extracting BSL name generation logic: The BSL naming logic is
duplicated between ValidateBackupStorageLocations and
ReconcileBackupStorageLocations. Consider extracting this into a helper
function:
func (r *DataProtectionApplicationReconciler) getBSLName(bslSpec
*BackupLocation, index int) string {
if bslSpec.Name != "" {
return bslSpec.Name
}
return fmt.Sprintf("%s-%d", r.NamespacedName.Name, index+1)
}
- Add validation for empty names: While the current logic handles empty
names by generating them, consider validating that user-provided names
are not empty strings to avoid confusion.
/cherry-pick oadp-1.5 |
@shubham-pampattiwar: once the present PR merges, I will cherry-pick it on top of In 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 kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai, shubham-pampattiwar, weshayutin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/lgtm |
/retest |
@shubham-pampattiwar: This pull request references OADP-6459 which is a valid jira issue. In 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. |
@shubham-pampattiwar: all tests passed! Full PR test history. Your PR dashboard. 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@shubham-pampattiwar: new pull request created: #1887 In 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 kubernetes-sigs/prow repository. |
Why the changes were made
The
ValidateBackupStorageLocations()
function was missing validation to detect duplicate backup location names before BSL object creation.How to test the changes made
Added early validation in the BSL validation process to detect and reject duplicate backup location names, preventing the problematic state from occurring.
Expected behavior:
🤖 Generated with https://claude.ai/code
Co-Authored-By: Claude [email protected]