-
Notifications
You must be signed in to change notification settings - Fork 268
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
f4df8fe
fa8c077
fd7bc6a
c77a3a1
449e24e
84d415a
27af647
bf0d9e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ import ( | |
"context" | ||
"errors" | ||
"fmt" | ||
"log" | ||
"sync" | ||
|
||
"k8s.io/apimachinery/pkg/api/equality" | ||
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.