@@ -222,7 +222,7 @@ func (w *SyncWorker) Update(generation int64, desired configv1.Update, overrides
222
222
return w .status .DeepCopy ()
223
223
}
224
224
225
- if equalSyncWork (w .work , work ) {
225
+ if equalSyncWork (w .work , work , state ) {
226
226
klog .V (5 ).Info ("Update work is equal to current target; no change required" )
227
227
return w .status .DeepCopy ()
228
228
}
@@ -401,7 +401,7 @@ func (w *SyncWorker) calculateNext(work *SyncWork) bool {
401
401
w .lock .Lock ()
402
402
defer w .lock .Unlock ()
403
403
404
- changed := ! equalSyncWork (w .work , work )
404
+ changed := ! equalSyncWork (w .work , work , w . work . State )
405
405
406
406
// if this is the first time through the loop, initialize reconciling to
407
407
// the state Update() calculated (to allow us to start in reconciling)
@@ -465,7 +465,7 @@ func splitDigest(pullspec string) string {
465
465
}
466
466
467
467
// equalSyncWork returns true if a and b are equal.
468
- func equalSyncWork (a , b * SyncWork ) bool {
468
+ func equalSyncWork (a , b * SyncWork , state payload. State ) bool {
469
469
if a == b {
470
470
return true
471
471
}
@@ -475,14 +475,20 @@ func equalSyncWork(a, b *SyncWork) bool {
475
475
sameVersion := equalUpdate (a .Desired , b .Desired )
476
476
overridesEqual := reflect .DeepEqual (a .Overrides , b .Overrides )
477
477
478
+ var detected string
478
479
if ! sameVersion && ! overridesEqual {
479
- klog .V (5 ).Info ("Detected version and overrides changes" )
480
- return false
480
+ detected = "version and overrides changes"
481
481
} else if ! sameVersion {
482
- klog .V (5 ).Info ("Detected version change" )
483
- return false
482
+ detected = "version change"
484
483
} else if ! overridesEqual {
485
- klog .V (5 ).Info ("Detected overrides change" )
484
+ detected = "overrides change"
485
+ }
486
+ if detected != "" {
487
+ if state == payload .InitializingPayload {
488
+ klog .Warning ("Ignoring detected %s during payload initialization" , detected )
489
+ return true
490
+ }
491
+ klog .V (5 ).Info ("Detected %s" , detected )
486
492
return false
487
493
}
488
494
return true
0 commit comments