File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1+ Fix issue #9365, prevent fake completion notification due to multiple update of single PVR
Original file line number Diff line number Diff line change @@ -92,12 +92,18 @@ func newRestorer(
9292
9393 _ , _ = pvrInformer .AddEventHandler (
9494 cache.ResourceEventHandlerFuncs {
95- UpdateFunc : func (_ , obj any ) {
96- pvr := obj .(* velerov1api.PodVolumeRestore )
95+ UpdateFunc : func (oldObj , newObj any ) {
96+ pvr := newObj .(* velerov1api.PodVolumeRestore )
97+ pvrOld := oldObj .(* velerov1api.PodVolumeRestore )
98+
9799 if pvr .GetLabels ()[velerov1api .RestoreUIDLabel ] != string (restore .UID ) {
98100 return
99101 }
100102
103+ if pvr .Status .Phase == pvrOld .Status .Phase {
104+ return
105+ }
106+
101107 if pvr .Status .Phase == velerov1api .PodVolumeRestorePhaseCompleted || pvr .Status .Phase == velerov1api .PodVolumeRestorePhaseFailed || pvr .Status .Phase == velerov1api .PodVolumeRestorePhaseCanceled {
102108 r .resultsLock .Lock ()
103109 defer r .resultsLock .Unlock ()
You can’t perform that action at this time.
0 commit comments