Skip to content

Commit 48b59d1

Browse files
committed
pkg/cvo/sync_worker: Grow logging in SyncWorker.Update
To make it easier to debug situations where the CVO's Operator.sync logs Desired version from spec is ... but the sync worker itself doesn't seem to pick up the update [1,2]. [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1843505#c19 [2]: https://bugzilla.redhat.com/show_bug.cgi?id=1873900
1 parent d6475ef commit 48b59d1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkg/cvo/sync_worker.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,13 @@ func (w *SyncWorker) Update(generation int64, desired configv1.Update, overrides
213213
w.work.Generation = generation
214214
}
215215

216-
if work.Empty() || equalSyncWork(w.work, work) {
216+
if work.Empty() {
217+
klog.V(5).Info("Update work has no release image; ignoring requested change")
218+
return w.status.DeepCopy()
219+
}
220+
221+
if equalSyncWork(w.work, work) {
222+
klog.V(5).Info("Update work is equal to current target; no change required")
217223
return w.status.DeepCopy()
218224
}
219225

@@ -234,12 +240,15 @@ func (w *SyncWorker) Update(generation int64, desired configv1.Update, overrides
234240
// notify the sync loop that we changed config
235241
w.work = work
236242
if w.cancelFn != nil {
243+
klog.V(5).Info("Cancel the sync worker's current loop")
237244
w.cancelFn()
238245
w.cancelFn = nil
239246
}
240247
select {
241248
case w.notify <- struct{}{}:
249+
klog.V(5).Info("Notify the sync worker that new work is available")
242250
default:
251+
klog.V(5).Info("The sync worker has already been notified that new work is available")
243252
}
244253

245254
return w.status.DeepCopy()

0 commit comments

Comments
 (0)