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

replace all occurrences of "node", nodeName to "node", klog.KRef("", nodeName) #99292

Merged
merged 2 commits into from
Mar 17, 2022

Conversation

yangjunmyfm192085
Copy link
Contributor

@yangjunmyfm192085 yangjunmyfm192085 commented Feb 22, 2021

Signed-off-by: JunYang yang.jun22@zte.com.cn

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

replace all occurrences of "node", nodeName to "node", klog.KRef("", nodeName)

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

part of kubernetes/enhancements#1602
As it is related to log, change the log here to structured log.

Does this PR introduce a user-facing change?

 "NONE"

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

 "NONE"

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 22, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @yangjunmyfm192085. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 22, 2021
@ping035627
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 10, 2021
@yangjunmyfm192085
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind-ipv6

1 similar comment
@yangjunmyfm192085
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind-ipv6

@yangjunmyfm192085 yangjunmyfm192085 force-pushed the run-test23 branch 2 times, most recently from 08640f8 to feb9363 Compare March 10, 2021 14:04
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 10, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Apr 10, 2021
@yangjunmyfm192085
Copy link
Contributor Author

/retest

@yangjunmyfm192085
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-ubuntu-containerd

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 6, 2022
@yangjunmyfm192085
Copy link
Contributor Author

@Huang-Wei, Thanks for reminding, I think the suggestions have been modified by other contributors.

@Huang-Wei
Copy link
Member

@yangjunmyfm192085 If I recall clearly, when I firstly review this PR, it's already off the topic of "optimizing usage of klog.ErrorS", right?

So my comment back then was to replace all occurrences of "node", nodeName to "node", klog.KRef("", nodeName), which are still valid in latest codebase:

wei.huang1@wei-imac:~/gospace/src/k8s.io/kubernetes|master ⇒  ag "klog.*\"node\", nodeName"
pkg/scheduler/framework/plugins/defaultbinder/default_binder.go
52:	klog.V(3).InfoS("Attempting to bind pod to node", "pod", klog.KObj(p), "node", nodeName)

pkg/controller/util/node/controller_utils.go
120:	klog.V(2).InfoS("Update ready status of pods on node", "node", nodeName)
168:	klog.V(2).InfoS("Recording event message for node", "event", event, "node", nodeName)

pkg/controller/podgc/gc_controller.go
203:				klog.ErrorS(err, "Error while getting node", "node", nodeName)

pkg/controller/nodelifecycle/scheduler/taint_manager.go
353:		klog.V(2).InfoS("Not all taints are tolerated after update for pod on node", "pod", podNamespacedName.String(), "node", nodeName)

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 6, 2022
@yangjunmyfm192085
Copy link
Contributor Author

Sorry, I misunderstood. Yeah, I get it now, and have updated the pr.
Could you please review again? thanks @Huang-Wei

@ahg-g
Copy link
Member

ahg-g commented Jan 6, 2022

can you please update the PR title

@yangjunmyfm192085 yangjunmyfm192085 changed the title Optimize the use of klog.Errors replace all occurrences of "node", nodeName to "node", klog.KRef("", nodeName) Jan 6, 2022
@yangjunmyfm192085
Copy link
Contributor Author

@ahg-g I have updated, could you please review again, thanks

@haosdent
Copy link
Member

haosdent commented Jan 7, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 7, 2022
@ahg-g
Copy link
Member

ahg-g commented Jan 8, 2022

/lgtm
/approve

@Huang-Wei
Copy link
Member

Waiting for @kubernetes/api-approvers to /approve.

Copy link
Contributor Author

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

/assign @cheftako
Could you help approve this pr? thanks

@yangjunmyfm192085
Copy link
Contributor Author

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jan 13, 2022
Copy link
Contributor Author

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

/ping @cheftako

Copy link
Contributor Author

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

/assign @deads2k

@cheftako
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, cheftako, yangjunmyfm192085

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 17, 2022
@k8s-ci-robot k8s-ci-robot merged commit f979b40 into kubernetes:master Mar 17, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging.
Development

Successfully merging this pull request may close these issues.

None yet