mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-06 13:26:26 +00:00
Merge branch 'main' into cache-volume-configuration
This commit is contained in:
1
changelogs/unreleased/9375-Lyndon-Li
Normal file
1
changelogs/unreleased/9375-Lyndon-Li
Normal file
@@ -0,0 +1 @@
|
||||
Fix issue #9365, prevent fake completion notification due to multiple update of single PVR
|
||||
@@ -92,12 +92,18 @@ func newRestorer(
|
||||
|
||||
_, _ = pvrInformer.AddEventHandler(
|
||||
cache.ResourceEventHandlerFuncs{
|
||||
UpdateFunc: func(_, obj any) {
|
||||
pvr := obj.(*velerov1api.PodVolumeRestore)
|
||||
UpdateFunc: func(oldObj, newObj any) {
|
||||
pvr := newObj.(*velerov1api.PodVolumeRestore)
|
||||
pvrOld := oldObj.(*velerov1api.PodVolumeRestore)
|
||||
|
||||
if pvr.GetLabels()[velerov1api.RestoreUIDLabel] != string(restore.UID) {
|
||||
return
|
||||
}
|
||||
|
||||
if pvr.Status.Phase == pvrOld.Status.Phase {
|
||||
return
|
||||
}
|
||||
|
||||
if pvr.Status.Phase == velerov1api.PodVolumeRestorePhaseCompleted || pvr.Status.Phase == velerov1api.PodVolumeRestorePhaseFailed || pvr.Status.Phase == velerov1api.PodVolumeRestorePhaseCanceled {
|
||||
r.resultsLock.Lock()
|
||||
defer r.resultsLock.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user