Skip to content

chore(kubelet): migrate eviction to contextual logging #131504

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhifei92
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

migrate eviction to contextual logging

Which issue(s) this PR fixes:

Fixes #
part of #130069

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

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


@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/XL Denotes a PR that changes 500-999 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. labels Apr 28, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Apr 28, 2025
@k8s-ci-robot k8s-ci-robot requested review from ffromani and hwdef April 28, 2025 03:29
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zhifei92
Once this PR has been reviewed and has the lgtm label, please assign dchen1107 for approval. For more information see the Code Review Process.

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

@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 28, 2025
@zhifei92
Copy link
Contributor Author

/cc @bart0sh

@k8s-ci-robot k8s-ci-robot requested a review from bart0sh April 28, 2025 03:34
@hwdef
Copy link
Member

hwdef commented Apr 28, 2025

Let's fix the CI first.

func (_m *MockNotifierFactory) NewCgroupNotifier(path string, attribute string, threshold int64) (CgroupNotifier, error) {
ret := _m.Called(path, attribute, threshold)
// NewCgroupNotifier provides a mock function with given fields: logger, path, attribute, threshold
func (_m *MockNotifierFactory) NewCgroupNotifier(logger logr.Logger, path string, attribute string, threshold int64) (CgroupNotifier, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

logr is an internal klog dependency. Please, use klog.Logger instead.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2025
@bart0sh bart0sh moved this from Triage to Waiting on Author in SIG Node: code and documentation PRs May 7, 2025
@bart0sh
Copy link
Contributor

bart0sh commented May 7, 2025

@zhifei92 Please rebase and fix CI failures, thanks!

@zhifei92 zhifei92 force-pushed the migrate-kubelet-eviction-to-contextual-logging branch from 62b899f to c8837fa Compare May 8, 2025 12:08
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 8, 2025
@zhifei92 zhifei92 force-pushed the migrate-kubelet-eviction-to-contextual-logging branch 3 times, most recently from 9d99ab9 to 070bde4 Compare May 9, 2025 03:25
fix failed unit test

fix unittest for windows

format code
@zhifei92 zhifei92 force-pushed the migrate-kubelet-eviction-to-contextual-logging branch from 25cdfaa to fd1786f Compare May 9, 2025 05:29
@zhifei92
Copy link
Contributor Author

zhifei92 commented May 9, 2025

Please rebase and fix CI failures, thanks!

Done.

@zhifei92
Copy link
Contributor Author

zhifei92 commented May 9, 2025

/retest-required

} else {
go notifier.Start()
go notifier.Start(logger)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to pass context here?

@@ -279,6 +280,7 @@ type podToMake struct {
}

func TestMemoryPressure_VerifyPodStatus(t *testing.T) {
_, tCtx := ktesting.NewTestContext(t)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_, tCtx := ktesting.NewTestContext(t)
tCtx := ktesting.Init(t)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: Waiting on Author
Development

Successfully merging this pull request may close these issues.

4 participants