Skip to content

Commit 6d56c65

Browse files
Merge pull request #451 from wking/update-logic-logging
Bug 1873900: pkg/cvo/sync_worker: Grow logging in SyncWorker.Update
2 parents f9f5591 + 48b59d1 commit 6d56c65

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)