Skip to content

Add DRA support to ordered-upgrade state machine#1291

Open
TomerNewman wants to merge 1 commit into
kubernetes-sigs:mainfrom
TomerNewman:MGMT-24474-dra-version-label-action-table
Open

Add DRA support to ordered-upgrade state machine#1291
TomerNewman wants to merge 1 commit into
kubernetes-sigs:mainfrom
TomerNewman:MGMT-24474-dra-version-label-action-table

Conversation

@TomerNewman

@TomerNewman TomerNewman commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extend the NodeLabelModuleVersionReconciler to handle DRA modules through the same ordered-upgrade label action table used by device plugin modules, adding a new version-dra node label prefix
  • Parameterize getLabelAndAction with a role-specific label function so the existing state machine works for both device plugin and DRA without duplication
  • Make the DRA reconciler version-aware: include version-dra in DaemonSet node selectors, create per-version DaemonSets (to avoid immutable selector errors on upgrade), and garbage collect old-version DaemonSets

Changes

  • internal/constants/constants.go — new DRAVersionLabelPrefix constant
  • internal/utils/kmmlabels.go — new GetDRAVersionLabelName, IsDRAVersionLabel; refactored GetNodesVersionLabels to use IsVersionLabel
  • internal/controllers/node_label_module_version_reconciler.go — added isDRA/draVersionLabel fields, setModulesDRAStatus (with graceful fallback when Module CR is deleted), getDRAPods via shared getDaemonSetPods helper, resolveLabel for role dispatch
  • internal/controllers/dra_reconciler.go — version label in DaemonSet labels + node selector, getExistingDRADSFromVersion, handleDRA version-aware creation, garbageCollectDRADaemonSets
  • Tests updated across all changed files with full DRA path coverage

Test plan

  • Unit tests: 385 controller specs, 44 utils specs — all passing
  • go vet and go build ./... clean
  • E2E on Minikube: deployed v1 DRA module (kmm_ci_a), upgraded to v2 (kmm_ci_b) via version-module label change, verified full label transition sequence, DRA DaemonSet lifecycle (new DS created, old GC'd), and kernel module swap via lsmod — zero controller errors

Extend the NodeLabelModuleVersionReconciler to handle DRA modules
through the same ordered-upgrade label action table used by device
plugin modules. The reconciler now detects whether a module uses DRA
(via spec.dra) and routes label resolution to the version-dra label
instead of version-device-plugin, reusing the existing state machine
without modification.
@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for kubernetes-sigs-kmm ready!

Name Link
🔨 Latest commit 743eed4
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-kmm/deploys/6a392a573c9dcc0008bde143
😎 Deploy Preview https://deploy-preview-1291--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 project configuration.

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TomerNewman

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

@kubernetes-prow kubernetes-prow Bot added 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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 22, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.90722% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.01%. Comparing base (fa23a9b) to head (743eed4).
⚠️ Report is 386 commits behind head on main.

Files with missing lines Patch % Lines
internal/controllers/dra_reconciler.go 94.44% 1 Missing and 1 partial ⚠️
internal/utils/kmmlabels.go 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1291      +/-   ##
==========================================
- Coverage   79.09%   74.01%   -5.08%     
==========================================
  Files          51       67      +16     
  Lines        5109     5069      -40     
==========================================
- Hits         4041     3752     -289     
- Misses        882     1147     +265     
+ Partials      186      170      -16     

☔ View full report in Codecov by Harness.
📢 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

Copy link
Copy Markdown
Collaborator Author

/retest

2 similar comments
@TomerNewman

Copy link
Copy Markdown
Collaborator Author

/retest

@TomerNewman

Copy link
Copy Markdown
Collaborator Author

/retest

@TomerNewman

Copy link
Copy Markdown
Collaborator Author

/assign @ybettan @yevgeny-shnaidman

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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants