Skip to content

Conversation

@TomerNewman
Copy link
Contributor

Until now, the nmc status reflected all the worker-pod tolerations, including those unrelated to KMM.
This commit updates the behavior to get tolerations from a dedicated annotation instead, ensuring only KMM-specific tolerations appear in the status.


/cc @ybettan @yevgeny-shnaidman

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 24, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @TomerNewman. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

Details

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 24, 2025
@netlify
Copy link

netlify bot commented Apr 24, 2025

Deploy Preview for kubernetes-sigs-kmm ready!

Name Link
🔨 Latest commit c85d519
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kmm/deploys/680f377a89074a000828c7ac
😎 Deploy Preview https://deploy-preview-1091--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.

@ybettan
Copy link
Contributor

ybettan commented Apr 28, 2025

Can we please rename the commit/PR title to something like Remove non KMM related tolerations from the NMC status

@ybettan
Copy link
Contributor

ybettan commented Apr 28, 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 Apr 28, 2025
@codecov-commenter
Copy link

codecov-commenter commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 22.22222% with 21 lines in your changes missing coverage. Please review.

Project coverage is 74.95%. Comparing base (fa23a9b) to head (c85d519).
Report is 270 commits behind head on main.

Files with missing lines Patch % Lines
internal/pod/workerpodmanager.go 25.00% 12 Missing and 3 partials ⚠️
internal/controllers/nmc_reconciler.go 14.28% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1091      +/-   ##
==========================================
- Coverage   79.09%   74.95%   -4.15%     
==========================================
  Files          51       76      +25     
  Lines        5109     6903    +1794     
==========================================
+ Hits         4041     5174    +1133     
- Misses        882     1515     +633     
- Partials      186      214      +28     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TomerNewman TomerNewman changed the title only kmm tolerations appear in nmc status Remove non KMM related tolerations from the NMC status Apr 28, 2025
@TomerNewman TomerNewman force-pushed the bugfix/nmc-status-holds-kmm-only-tolerations branch from 906aab4 to 2632f48 Compare April 28, 2025 07:04
if err = setWorkerConfigAnnotation(pod, nms.Config); err != nil {
return nil, fmt.Errorf("could not set worker config: %v", err)
}
if err = setWorkerTolerationsAnnotation(pod, nms.Tolerations); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Something doesn't sums up for me. If we always set the worker's annotation based on the NMC spec, then why do we need the annotation at all? We can take it from the NMC spec and it will be the same.

Neither one of the option doesn't reflect the "real" pod's tolerations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the tolerations in nmc spec changes for some reason while the worker pod runs from A to B, then later the status will be based on tolerations B (because we are doing status=spec), even though the worker pod ran with tolerations A.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are correct :)

continue
}
tolerationsAnnotation := h.podManager.GetTolerationsAnnotation(&p)
if tolerationsAnnotation != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to check if tolerationsAnnotation != "" ? won't Unmarshal knows to handle it by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yevgeny-shnaidman you are right, when I applied Module without tolerations it made null on the pod's annotation.
This should have be the fix but it is not correct, so now I changed setWorkerTolerationsAnnotation.

Until now, the  nmc status reflected all pod
tolerations, including those unrelated to KMM.

This commit updates the behavior to source
tolerations from a dedicated annotation instead,
ensuring only KMM-specific tolerations
appear in the status.
@TomerNewman TomerNewman force-pushed the bugfix/nmc-status-holds-kmm-only-tolerations branch from 2632f48 to c85d519 Compare April 28, 2025 08:08
@yevgeny-shnaidman
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TomerNewman, yevgeny-shnaidman

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 28, 2025
@ybettan
Copy link
Contributor

ybettan commented Apr 28, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 28, 2025
@k8s-ci-robot k8s-ci-robot merged commit 84873c2 into kubernetes-sigs:main Apr 28, 2025
22 checks passed
@TomerNewman TomerNewman deleted the bugfix/nmc-status-holds-kmm-only-tolerations branch June 3, 2025 13:44
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants