Merge pull request #7924 from anshulahuja98/snapshotsync

In backup sync flow put snapshotHandle as source in CSI VSContent
pull/7967/head
Shubham Pampattiwar 2024-07-01 11:54:26 -07:00 committed by GitHub
commit 6a7f146aed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

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):