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

Handling of kmm module ready label (kernel module is loaded) #575

Conversation

yevgeny-shnaidman
Copy link
Contributor

@yevgeny-shnaidman yevgeny-shnaidman commented Sep 24, 2023

This PR adds the ability to add/remove
kmm.node.kubernetes.io/%s.%s.ready label to the node. This is done based on the current labels on the node, and the comparison between NMC module's spec and status. State machine for adding/removing:

  1. if spec config and status config are not equal - node's label should stay as is (either present or missing)
  2. if both spec and status are missing - node's label should be removed
  3. if spec config and status config are equal - node's label should be set

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

netlify bot commented Sep 24, 2023

Deploy Preview for kubernetes-sigs-kmm ready!

Name Link
🔨 Latest commit 594eaec
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kmm/deploys/65120bcea204c90008b653c0
😎 Deploy Preview https://deploy-preview-575--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.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 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 Sep 24, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2023

Codecov Report

Patch coverage: 83.72% and project coverage change: +0.03% 🎉

Comparison is base (3182c54) 80.14% compared to head (617431c) 80.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #575      +/-   ##
==========================================
+ Coverage   80.14%   80.17%   +0.03%     
==========================================
  Files          45       45              
  Lines        4513     4556      +43     
==========================================
+ Hits         3617     3653      +36     
- Misses        733      739       +6     
- Partials      163      164       +1     
Files Changed Coverage Δ
internal/utils/kmmlabels.go 28.57% <0.00%> (-3.01%) ⬇️
internal/controllers/nmc_reconciler.go 77.24% <92.30%> (+0.88%) ⬆️

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

@yevgeny-shnaidman yevgeny-shnaidman force-pushed the yevgeny/module-ready-label branch from 529f34f to 617431c Compare September 24, 2023 14:17
internal/utils/kmmlabels.go Outdated Show resolved Hide resolved
internal/utils/kmmlabels.go Outdated Show resolved Hide resolved
This PR adds the ability to add/remove
kmm.node.kubernetes.io/%s.%s.ready label to the node.
This is done based on the current labels on the node, and the comparison
between NMC module's spec and status. State machine for adding/removing:
1) if spec config and status config are not equal - node's label should
   stay as is (either present or missing)
2) if both spec and status are missing - node's label should be removed
3) if spec config and status config are equal - node's label should be
   set
@yevgeny-shnaidman yevgeny-shnaidman force-pushed the yevgeny/module-ready-label branch from 617431c to 594eaec Compare September 25, 2023 22:38
@qbarrand
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 Sep 26, 2023
@k8s-ci-robot k8s-ci-robot merged commit e524b93 into kubernetes-sigs:main Sep 26, 2023
@qbarrand qbarrand linked an issue Sep 27, 2023 that may be closed by this pull request
qbarrand pushed a commit to qbarrand/kernel-module-management that referenced this pull request Nov 8, 2023
…tes-sigs#575) (kubernetes-sigs#788)

This PR adds the ability to add/remove
kmm.node.kubernetes.io/%s.%s.ready label to the node.
This is done based on the current labels on the node, and the comparison
between NMC module's spec and status. State machine for adding/removing:
1) if spec config and status config are not equal - node's label should
   stay as is (either present or missing)
2) if both spec and status are missing - node's label should be removed
3) if spec config and status config are equal - node's label should be
   set
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.

Add node labeling to the NodeModulesConfig controller
4 participants