Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1873900: pkg/cvo/sync_worker: Grow logging in SyncWorker.Update #451

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion pkg/cvo/sync_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ func (w *SyncWorker) Update(generation int64, desired configv1.Update, overrides
w.work.Generation = generation
}

if work.Empty() || equalSyncWork(w.work, work) {
if work.Empty() {
klog.V(5).Info("Update work has no release image; ignoring requested change")
return w.status.DeepCopy()
}

if equalSyncWork(w.work, work) {
klog.V(5).Info("Update work is equal to current target; no change required")
return w.status.DeepCopy()
}

Expand All @@ -234,12 +240,15 @@ func (w *SyncWorker) Update(generation int64, desired configv1.Update, overrides
// notify the sync loop that we changed config
w.work = work
if w.cancelFn != nil {
klog.V(5).Info("Cancel the sync worker's current loop")
w.cancelFn()
w.cancelFn = nil
}
select {
case w.notify <- struct{}{}:
klog.V(5).Info("Notify the sync worker that new work is available")
default:
klog.V(5).Info("The sync worker has already been notified that new work is available")
}

return w.status.DeepCopy()
Expand Down