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

Added Log output for LocalQueue and ClusterQueue #3605

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/controller/core/workload_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ func (r *WorkloadReconciler) Update(e event.UpdateEvent) bool {
// function.
if immediate {
if !r.queues.AddOrUpdateWorkloadWithoutLock(wlCopy) {
log.V(2).Info("LocalQueue for workload didn't exist or not active; ignored for now")
}
}
})
Expand Down
3 changes: 3 additions & 0 deletions pkg/queue/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"log"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use this logger.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll replace it with fmt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need logger at all. You need to return error instead.

"sync"

"k8s.io/apimachinery/pkg/api/equality"
Expand Down Expand Up @@ -329,12 +330,14 @@ func (m *Manager) AddOrUpdateWorkloadWithoutLock(w *kueue.Workload) bool {
qKey := workload.QueueKey(w)
q := m.localQueues[qKey]
if q == nil {
log.Printf("LocalQueue for workload not found; queueKey: %s, workload: %s", qKey, w.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it’s much better to return an error here with a message like 'LocalQueue for workload not found' or 'ClusterQueue for workload not found'.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for sure :)

return false
}
wInfo := workload.NewInfo(w, m.workloadInfoOptions...)
q.AddOrUpdate(wInfo)
cq := m.hm.ClusterQueues[q.ClusterQueue]
if cq == nil {
log.Printf("ClusterQueue for workload not found; clusterQueue: %s, workload: %s", q.ClusterQueue, w.Name)
return false
}
cq.PushOrUpdate(wInfo)
Expand Down