Skip to content

kubelet: clean up circular dependencies around admitHandlers and container runtime #132609

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

Conversation

mahmoudaboueleneen
Copy link

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR removes circular dependencies between the kubelet's admitHandlers and the container runtime by restructuring the initialization sequence.

Which issue(s) this PR is related to:

Fixes: #132298

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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Jun 29, 2025
Copy link

linux-foundation-easycla bot commented Jun 29, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: mahmoudaboueleneen / name: Mahmoud Abou Eleneen (eb89f97, ca9d4bb)

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 29, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @mahmoudaboueleneen!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/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 Jun 29, 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
Copy link
Contributor

Hi @mahmoudaboueleneen. 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-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 Jun 29, 2025
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. labels Jun 29, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 29, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mahmoudaboueleneen
Once this PR has been reviewed and has the lgtm label, please assign yujuhong 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 29, 2025
@carlory
Copy link
Member

carlory commented Jun 30, 2025

/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 Jun 30, 2025
@pacoxu
Copy link
Member

pacoxu commented Jun 30, 2025

/cc @natasha41575

@k8s-ci-robot k8s-ci-robot removed the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 30, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 30, 2025
@k8s-ci-robot
Copy link
Contributor

@mahmoudaboueleneen: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-e2e-kind ca9d4bb link true /test pull-kubernetes-e2e-kind
pull-kubernetes-node-e2e-containerd ca9d4bb link true /test pull-kubernetes-node-e2e-containerd
pull-kubernetes-conformance-kind-ga-only-parallel ca9d4bb link true /test pull-kubernetes-conformance-kind-ga-only-parallel
pull-kubernetes-unit ca9d4bb link true /test pull-kubernetes-unit
pull-kubernetes-linter-hints ca9d4bb link false /test pull-kubernetes-linter-hints
pull-kubernetes-e2e-gce ca9d4bb link true /test pull-kubernetes-e2e-gce
pull-kubernetes-unit-windows-master ca9d4bb link false /test pull-kubernetes-unit-windows-master

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@ylink-lfs
Copy link
Contributor

ylink-lfs commented Jul 1, 2025

I tried this approach (rewriting the constructor of the allocation manager) to solve the circular dependency problem; however, it may not be the best solution. Your PR (eb89f97) didn't rewrite related test files, and there are tons of usages related to kubelet initialization (which use custom admitHandlers or not to initialize the allocationManager) in those test files. Applying changes to ALL related test files would create an XXL PR, much bigger than the current one.

@mahmoudaboueleneen
Copy link
Author

@ylink-lfs I see, thank you for the insight. Do you have any suggestions as to how to proceed?

@ylink-lfs
Copy link
Contributor

@ylink-lfs I see, thank you for the insight. Do you have any suggestions as to how to proceed?

I raised an implementation plan discussion waiting for maintainers'suggestion in the related issue

@mahmoudaboueleneen
Copy link
Author

@ylink-lfs I see, thank you for the insight. Do you have any suggestions as to how to proceed?

I raised an implementation plan discussion waiting for maintainers'suggestion in the related issue

Alright, should I close this PR and attempt another issue? Seems a bit big for a good first issue

@ylink-lfs
Copy link
Contributor

ylink-lfs commented Jul 1, 2025

@ylink-lfs I see, thank you for the insight. Do you have any suggestions as to how to proceed?

I raised an implementation plan discussion waiting for maintainers'suggestion in the related issue

Alright, should I close this PR and attempt another issue? Seems a bit big for a good first issue

It may be a good-second-issue. Harder than deprecation utilities replacement and coverage-driven works definitely.

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. 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/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Development

Successfully merging this pull request may close these issues.

Clean up circular dependencies around the kubelet's admitHandlers and the container runtime
5 participants