Skip to content

Gate DRA reconciler on Kubernetes >= 1.34#1300

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:mainfrom
TomerNewman:fix/gate-dra-reconciler-on-kube-version
Jul 1, 2026
Merged

Gate DRA reconciler on Kubernetes >= 1.34#1300
kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:mainfrom
TomerNewman:fix/gate-dra-reconciler-on-kube-version

Conversation

@TomerNewman

Copy link
Copy Markdown
Collaborator

The DRA reconciler was registered unconditionally, which would crash the entire operator on clusters older than 1.34 because the resource.k8s.io/v1 DeviceClass API does not exist there.

Introduce an internal/version package with KubeVersion, DiscoverKubeVersion, and an AtLeast method to centralise version discovery and comparison. The manager now checks the cluster version at startup and only registers the DRA controller when the minimum version is met. The webhook package is updated to use the shared version package instead of its own local types.

Also fixes a pre-existing bug where /run was missing from the allowed hostPath prefixes error message.


/cc @ybettan @yevgeny-shnaidman
/assign @ybettan @yevgeny-shnaidman

The DRA reconciler was registered unconditionally, which would crash the
entire operator on clusters older than 1.34 because the resource.k8s.io/v1
DeviceClass API does not exist there.

Introduce an internal/version package with KubeVersion, DiscoverKubeVersion,
and an AtLeast method to centralise version discovery and comparison. The
manager now checks the cluster version at startup and only registers the DRA
controller when the minimum version is met. The webhook package is updated to
use the shared version package instead of its own local types.

Also fixes a pre-existing bug where /run was missing from the allowed
hostPath prefixes error message.
@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for kubernetes-sigs-kmm ready!

Name Link
🔨 Latest commit 767e145
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-kmm/deploys/6a44f57507c06300085d80e8
😎 Deploy Preview https://deploy-preview-1300--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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 1, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.29787% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.73%. Comparing base (fa23a9b) to head (767e145).
⚠️ Report is 391 commits behind head on main.

Files with missing lines Patch % Lines
cmd/manager/main.go 0.00% 15 Missing ⚠️
internal/version/version.go 42.85% 10 Missing and 2 partials ⚠️
cmd/webhook-server/main.go 0.00% 1 Missing ⚠️
...ternal/webhook/hub/managedclustermodule_webhook.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1300      +/-   ##
==========================================
- Coverage   79.09%   73.73%   -5.36%     
==========================================
  Files          51       68      +17     
  Lines        5109     5114       +5     
==========================================
- Hits         4041     3771     -270     
- Misses        882     1170     +288     
+ Partials      186      173      -13     

☔ 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.

@yevgeny-shnaidman

Copy link
Copy Markdown
Contributor

/lgtm

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 1, 2026
@kubernetes-prow kubernetes-prow Bot merged commit 36567c5 into kubernetes-sigs:main Jul 1, 2026
23 checks passed
@TomerNewman TomerNewman deleted the fix/gate-dra-reconciler-on-kube-version branch July 1, 2026 12:10
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