feat: allow matching USB devices to be scheduled individually - #232
Open
lucbelliveau wants to merge 1 commit into
Open
lucbelliveau wants to merge 1 commit into
lucbelliveau wants to merge 1 commit into
Conversation
Owner
|
Interesting! I wonder if the current behavior is in fact intentional or a bug. I'm trying to reason about why it would be desirable to have all matching devices allocated as a group. Do you have insight into this? I need to review old code to check. This would help me reason about whether your change should introduced an option or just change the default behavior. |
Author
|
Afraid I don't know anyone else who uses this plugin, my biggest concern would be to break existing deployments if they rely on the opposite... but coming from someone who had never seen this plugin, I did not expect it to behave the way it did... adding the option with a default to false seemed the sensible thing to do... |
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.
Currently, when a USB specification matches multiple physical devices, all matches are combined into a single allocatable meta-device. This means that requesting the resource causes all matching USB devices to be allocated to the same Pod.
This PR adds an opt-in individual setting to USB groups. When enabled, the plugin creates a separate allocatable device for each matching instance of the USB group.
For example:
devices:
groups:
product: "5678"
individual: true
If three physical cameras match this specification, the plugin advertises three allocatable devices, allowing three Pods to independently request one camera each.
For groups containing multiple USB specifications, matches are combined by instance to preserve the existing meta-device semantics. For example, matches A1, A2 and B1, B2 produce two allocatable devices: {A1, B1} and {A2, B2}.
The existing behavior remains the default when individual is omitted or set to false, so existing configurations are unaffected.
Tests cover:
the existing grouped behavior;
individually allocatable matches for a single USB specification; and
grouping individual instances across multiple USB specifications.