-
Notifications
You must be signed in to change notification settings - Fork 262
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?
Conversation
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 7h3-3mp7y-m4n The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @7h3-3mp7y-m4n! |
Hi @7h3-3mp7y-m4n. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
pkg/queue/manager.go
Outdated
@@ -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 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'.
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.
for sure :)
pkg/queue/manager.go
Outdated
@@ -20,6 +20,7 @@ import ( | |||
"context" | |||
"errors" | |||
"fmt" | |||
"log" |
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.
@mbobrovskyi: /release-note-edit must be used with a release note block. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
/release-note-edit
|
/assign @gabesaba |
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
@@ -329,12 +329,14 @@ func (m *Manager) AddOrUpdateWorkloadWithoutLock(w *kueue.Workload) bool { | |||
qKey := workload.QueueKey(w) | |||
q := m.localQueues[qKey] | |||
if q == nil { | |||
fmt.Println("LocalQueue for workload not found") |
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.
fmt.Println("LocalQueue for workload not found") | |
return ErrQueueDoesNotExist |
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!
return false | ||
} | ||
wInfo := workload.NewInfo(w, m.workloadInfoOptions...) | ||
q.AddOrUpdate(wInfo) | ||
cq := m.hm.ClusterQueues[q.ClusterQueue] | ||
if cq == nil { | ||
fmt.Println("ClusterQueue for workload not found") |
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.
fmt.Println("ClusterQueue for workload not found") | |
return ErrClusterQueueDoesNotExist |
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!
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.
if we do this then we have to change the type of the function cause it was returning a bool and after adding this it should return error ..
so should I add it like you mentioned or anything other?
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.
Yes, sure.
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!
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR added Log output for LocalQueue and ClusterQueue
Which issue(s) this PR fixes:
Fixes #3527
Special notes for your reviewer:
It added some log output for better debugging without breaking the function..
Does this PR introduce a user-facing change?
NONE