-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
migrate scheduling_queue.go to structured logging #98358
migrate scheduling_queue.go to structured logging #98358
Conversation
@tanjing2020: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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/test-infra repository. |
Hi @tanjing2020. Thanks for your PR. I'm waiting for a kubernetes 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/test-infra repository. |
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.
/ok-to-test
/lgtm
Just notice this one is kind of duplicated with #98135. |
Ah true, I didn't notice that. |
b3c697c
to
af33dcd
Compare
af33dcd
to
3e096cb
Compare
#98135 removed duplicate file, please review again, thanks. |
3e096cb
to
a5994b7
Compare
@@ -299,14 +291,14 @@ func (p *PriorityQueue) AddUnschedulableIfNotPresent(pInfo *framework.QueuedPodI | |||
defer p.lock.Unlock() | |||
pod := pInfo.Pod | |||
if p.unschedulableQ.get(pod) != nil { | |||
return fmt.Errorf("pod: %v is already present in unschedulable queue", nsNameForPod(pod)) | |||
return fmt.Errorf("pod %v is already present in unschedulable queue", klog.KObj(pod)) |
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.
return fmt.Errorf("pod %v is already present in unschedulable queue", klog.KObj(pod)) | |
return fmt.Errorf("Pod is already present in unschedulable queue", "pod", klog.KObj(pod)) |
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.
Errorf formats according to a format specifier and returns the string as a value that satisfies error.
https://golang.org/pkg/fmt/#Errorf
I think it's better to keep the original modification.
} | ||
|
||
if _, exists, _ := p.activeQ.Get(pInfo); exists { | ||
return fmt.Errorf("pod: %v is already present in the active queue", nsNameForPod(pod)) | ||
return fmt.Errorf("pod %v is already present in the active queue", klog.KObj(pod)) |
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.
return fmt.Errorf("pod %v is already present in the active queue", klog.KObj(pod)) | |
return fmt.Errorf("Pod is already present in the active queue", "pod", klog.KObj(pod)) |
} | ||
if _, exists, _ := p.podBackoffQ.Get(pInfo); exists { | ||
return fmt.Errorf("pod %v is already present in the backoff queue", nsNameForPod(pod)) | ||
return fmt.Errorf("pod %v is already present in the backoff queue", klog.KObj(pod)) |
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.
return fmt.Errorf("pod %v is already present in the backoff queue", klog.KObj(pod)) | |
return fmt.Errorf("Pod is already present in the backoff queue", "pod", klog.KObj(pod)) |
a5994b7
to
223ef1d
Compare
p.unschedulableQ.delete(pod) | ||
} | ||
// Delete pod from backoffQ if it is backing off | ||
if err := p.podBackoffQ.Delete(pInfo); err == nil { | ||
klog.Errorf("Error: pod %v is already in the podBackoff queue.", nsNameForPod(pod)) | ||
klog.ErrorS(err, "Error: pod is already in the podBackoff queue", "pod", klog.KObj(pod)) |
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.
nit: err
is always nil here
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.
Done.
223ef1d
to
d0eecbd
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damemi, tanjing2020 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Ref:
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/1602-structured-logging
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md
Which issue(s) this PR fixes:
Verify log output (scheduling_queue.go)
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: