In backup sync flow put snapshotHandle as source in CSI VSContent

Signed-off-by: Anshul Ahuja <anshulahuja@microsoft.com>
This commit is contained in:
Anshul Ahuja
2024-06-25 11:53:54 +00:00
parent b0dc189311
commit d1d331faa8

View File

@@ -272,6 +272,10 @@ func (b *backupSyncReconciler) Reconcile(ctx context.Context, req ctrl.Request)
for _, snapCont := range snapConts {
// TODO: Reset ResourceVersion prior to persisting VolumeSnapshotContents
snapCont.ResourceVersion = ""
// For creating static VSContent, we should put snapshothandle in source rather than volume handle.
// Because if VSContent syncs to a different cluster, having volumeHandle will force rePUTs on the snapshot
snapCont.Spec.Source.SnapshotHandle = snapCont.Status.SnapshotHandle
snapCont.Spec.Source.VolumeHandle = nil
err := b.client.Create(ctx, snapCont, &client.CreateOptions{})
switch {
case err != nil && apierrors.IsAlreadyExists(err):