OADP-1833: Cleanup completed VSBs in backup finalize phase#263
OADP-1833: Cleanup completed VSBs in backup finalize phase#263shubham-pampattiwar wants to merge 1 commit into
Conversation
|
@shubham-pampattiwar: This pull request references OADP-1833 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 kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shubham-pampattiwar 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 |
|
@shubham-pampattiwar: The following test failed, say
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/test-infra repository. I understand the commands that are listed here. |
| } | ||
|
|
||
| // check if the VSBs associated with the backup are in completed state, if yes then clean them up | ||
| err = datamover.DeleteVSBsIfComplete(backup.Name) |
There was a problem hiding this comment.
would it be better to pass r.client instead of making a new one?
There was a problem hiding this comment.
not sure if you could here since VSBs are not in the same ns
There was a problem hiding this comment.
For clientsets maybe.. this is normal kbclient
There is nothing ns specific about this. You still have to specify namespace in the object.metadata during get/create/update
func GetVolumeSnapMoverClient() (kbclient.Client, error) {
client, err := kbclient.New(config.GetConfigOrDie(), kbclient.Options{})
if err != nil {
return nil, err
}
err = snapmoverv1alpha1.AddToScheme(client.Scheme())
if err != nil {
return nil, err
}
return client, err
}
|
|
| } | ||
|
|
||
| // check if the VSBs associated with the backup are in completed state, if yes then clean them up | ||
| err = datamover.DeleteVSBsIfComplete(backup.Name) |
There was a problem hiding this comment.
not sure if you could here since VSBs are not in the same ns
| if cond.Status == metav1.ConditionFalse && cond.Reason == ReconciledReasonError && cond.Type == ConditionReconciled { | ||
| return false, errors.Errorf("volumesnapshotbackup %s has failed status", currentVSB.Name) | ||
| } | ||
| } |
There was a problem hiding this comment.
Could also add in a check for VSB phase being failed or partiallyFailed. Because there are instances where conditions will be false, such as the objectModified error, but the controller will reconcile and have true conditions again.
|
Closing in favor of #268 |
No description provided.