-
Notifications
You must be signed in to change notification settings - Fork 6
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
PB-8347: Fix KDMP Backup Failure in-case KDMP job removed post VB CR is updated with SnapshotID #399
base: master
Are you sure you want to change the base?
Conversation
OSS Scan Results:
Total issues: 142 |
License Evaluation Results:
Total License Issues: 17 |
@@ -607,7 +607,7 @@ func UpdateResourceBackupStatus( | |||
} | |||
|
|||
// CreateVolumeBackup creates volumebackup CRD | |||
func CreateVolumeBackup(name, namespace, repository, blName, blNamespace string) error { | |||
func CreateVolumeBackup(name, namespace, repository, blName, blNamespace string) (bool, error) { |
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.
Is it necessary to change function signature?
Can't simply return nil if snaphotID is already there.
if volumeBackup.Status.SnapshotID != "" { // If SnapshotID exists, return early or handle accordingly return nil } // Proceed with the rest of the logic if SnapshotID does not exist
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.
If we return nil, then will go with the control flow and takes another snapshot (redoing the same work again). So instead will return from the runBackup to prevent taking another snapshot.
What this PR does / why we need it:
- Update CreateVolumeBackup to return a boolean based upon the snapshotID
- Update KopiaBackup runBackup to exit successfully in case the VB CR already holds the snapshotID
Which issue(s) this PR fixes (optional)
Closes #PB-8347
Special notes for your reviewer:
PFA of Testing Screenshots