feat(usb): NodeUSBDevice controller#1913
Open
danilrwx wants to merge 3 commits intofeat/dra-usbipfrom
Open
Conversation
29be831 to
b276ce0
Compare
b276ce0 to
9b7436f
Compare
127101a to
7dadda9
Compare
fc3f7d8 to
3a040c2
Compare
dd2ef4f to
fce3c4d
Compare
a3a9f61 to
bdca1c1
Compare
d644166 to
aec501d
Compare
39c0a2b to
60c1742
Compare
97b0f7b to
ab4da86
Compare
60c1742 to
ef60a2f
Compare
Isteb4k
requested changes
Feb 19, 2026
...rtualization-artifact/pkg/controller/nodeusbdevice/internal/watcher/resourceslice_watcher.go
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/nodeusbdevice/internal/conditions.go
Outdated
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/nodeusbdevice/internal/assigned.go
Outdated
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/nodeusbdevice/internal/assigned.go
Outdated
Show resolved
Hide resolved
yaroslavborbat
requested changes
Feb 19, 2026
images/virtualization-artifact/pkg/controller/indexer/indexer.go
Outdated
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/resourceslice/internal/discovery.go
Outdated
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/vmchange/comparator_pod_placement.go
Outdated
Show resolved
Hide resolved
yaroslavborbat
requested changes
Feb 19, 2026
|
|
||
| // validateUSBDevicesUnique checks that each USB device is not used by another VM. | ||
| // currentVMName is empty for Create (no VM to exclude), or VM name for Update (exclude current VM from conflict check). | ||
| func (v *USBDevicesValidator) validateUSBDevicesUnique(ctx context.Context, vm *v1alpha2.VirtualMachine, currentVMName string) (admission.Warnings, error) { |
Member
There was a problem hiding this comment.
You don't need to check all USB devices, only the ones that are being added.
Member
There was a problem hiding this comment.
Rename the function to reflect that
yaroslavborbat
requested changes
Feb 19, 2026
...s/virtualization-artifact/pkg/controller/usbdevice/internal/watcher/nodeusbdevice_watcher.go
Outdated
Show resolved
Hide resolved
...lization-artifact/pkg/controller/usbdevice/internal/watcher/resourceclaimtemplate_watcher.go
Show resolved
Hide resolved
...lization-artifact/pkg/controller/usbdevice/internal/watcher/resourceclaimtemplate_watcher.go
Show resolved
Hide resolved
.../virtualization-artifact/pkg/controller/usbdevice/internal/watcher/virtualmachine_watcher.go
Outdated
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/usbdevice/internal/deletion.go
Outdated
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/usbdevice/internal/handler/lifecycle.go
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/usbdevice/internal/lifecycle.go
Outdated
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/usbdevice/usbdevice_webhook.go
Outdated
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/usbdevice/usbdevice_webhook.go
Outdated
Show resolved
Hide resolved
images/virtualization-artifact/pkg/controller/usbdevice/usbdevice_webhook.go
Outdated
Show resolved
Hide resolved
Isteb4k
requested changes
Feb 19, 2026
086afa3 to
f2929ed
Compare
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> fix Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
f2929ed to
6691b27
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added a new CRD
NodeUSBDeviceand controller for managing USB devices at the node level in the cluster.Why do we need it, and what problem does it solve?
The DRA (Dynamic Resource Allocation) system automatically discovers USB devices on cluster nodes and creates ResourceSlice resources. However, there was no convenient mechanism for managing these devices at the Kubernetes level:
Solution:
NodeUSBDevice provides an abstraction layer between physical USB devices on nodes (represented via ResourceSlice) and logical USBDevice resources in namespaces. This enables:
kubectl get nodeusbdevicesspec.assignedNamespaceWhat is the expected result?
Readycondition correctly reflects device presence on the nodeassignedNamespaceis set, a USBDevice is automatically created in the specified namespaceassignedNamespaceis changed or cleared, corresponding USBDevice resources are correctly deletedChecklist
Changelog entries