Skip to content

Commit 7047a99

Browse files
fix
Signed-off-by: Yaroslav Borbat <[email protected]>
1 parent de7b08f commit 7047a99

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

images/virtualization-artifact/pkg/controller/vd/internal/migration.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ func (h MigrationHandler) handleMigrate(ctx context.Context, vd *virtv2.VirtualD
166166
return nil
167167
}
168168

169+
// Reset migration info
170+
vd.Status.MigrationInfo = virtv2.VirtualDiskMigrationInfo{}
171+
169172
var targetStorageClass *storev1.StorageClass
170173
var err error
171174

images/virtualization-artifact/pkg/controller/vm/internal/migrating.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ func (h *MigratingHandler) syncMigrating(ctx context.Context, s state.VirtualMac
154154
var notReadyToMigrateDisks []string
155155
targetPVCNames := make(map[string]struct{})
156156
for _, vd := range nonMigratableVirtualDisks {
157-
// if target pvc is set, it means that the disk is ready to be migrated
158-
// after the migration is finished, target pvc will be removed and set to .status.target.persistentVolumeClaim
159-
if vd.Status.MigrationInfo.TargetPVC == "" {
157+
// if target pvc is set, it means that the disk is ready to be migrated,
158+
// but if end timestamp is set, it means that TargetPVC is old, and we should wait new one.
159+
if vd.Status.MigrationInfo.TargetPVC == "" || !vd.Status.MigrationInfo.EndTimestamp.IsZero() {
160160
notReadyToMigrateDisks = append(notReadyToMigrateDisks, vd.Name)
161161
}
162162
targetPVCNames[vd.Status.MigrationInfo.TargetPVC] = struct{}{}

0 commit comments

Comments
 (0)