Skip to content

Conversation

@ybettan
Copy link
Contributor

@ybettan ybettan commented Feb 20, 2025

When this interface was transitioned to the pod package, it was copied as is (as much as possible) and some variables had to be exported to be used as before.

Once the transition done, it was simpler to review some of those new exported env variables and convert them to usefull methods inside the WorkerPodManager interface.


/assign @yevgeny-shnaidman

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ybettan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 20, 2025
@netlify
Copy link

netlify bot commented Feb 20, 2025

Deploy Preview for kubernetes-sigs-kmm ready!

Name Link
🔨 Latest commit 8125ed7
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kmm/deploys/67b7064157d48e000802e161
😎 Deploy Preview https://deploy-preview-1025--kubernetes-sigs-kmm.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 27.50000% with 29 lines in your changes missing coverage. Please review.

Project coverage is 73.07%. Comparing base (fa23a9b) to head (8125ed7).
Report is 214 commits behind head on main.

Files with missing lines Patch % Lines
internal/pod/workerpodmanager.go 18.18% 27 Missing ⚠️
internal/controllers/nmc_reconciler.go 71.42% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1025      +/-   ##
==========================================
- Coverage   79.09%   73.07%   -6.03%     
==========================================
  Files          51       72      +21     
  Lines        5109     6076     +967     
==========================================
+ Hits         4041     4440     +399     
- Misses        882     1455     +573     
+ Partials      186      181       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ListWorkerPodsOnNode(ctx context.Context, nodeName string) ([]v1.Pod, error)
LoaderPodTemplate(ctx context.Context, nmc client.Object, nms *kmmv1beta1.NodeModuleSpec) (*v1.Pod, error)
UnloaderPodTemplate(ctx context.Context, nmc client.Object, nms *kmmv1beta1.NodeModuleStatus) (*v1.Pod, error)
IsLoaderPod(p v1.Pod) bool
Copy link
Contributor

Choose a reason for hiding this comment

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

I think all those function can receive a Pod pointer, instead of a Pod structure. Passing it as a struct mean copying it, and it is a large structure. There are a lot of functions , even in kuberenetes packages, that receive parameters as pointers, event though they are not changing them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

When this interface was transitioned to the `pod` package, it was copied
as is (as much as possible) and some variables had to be exported to be
used as before.

Once the transition done, it was simpler to review some of those new
exported env variables and convert them to usefull methods inside the
`WorkerPodManager` interface.

Signed-off-by: Yoni Bettan <[email protected]>
@yevgeny-shnaidman
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2025
@k8s-ci-robot k8s-ci-robot merged commit efe36a0 into kubernetes-sigs:main Feb 20, 2025
22 checks passed
@ybettan ybettan deleted the pod-exported-vars branch February 20, 2025 11:17
cdvultur pushed a commit to cdvultur/kernel-module-management that referenced this pull request Oct 22, 2025
Bumps [k8s.io/kubectl](https://github.com/kubernetes/kubectl) from 0.29.0 to 0.29.2.
- [Commits](kubernetes/kubectl@v0.29.0...v0.29.2)

---
updated-dependencies:
- dependency-name: k8s.io/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants