-
Notifications
You must be signed in to change notification settings - Fork 694
Feature: Registry for drivers and expose driver info in CLI #3692
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
Conversation
f95e8b0
to
bf3f567
Compare
f94cfcf
to
80dbaf2
Compare
2ab4f03
to
9a25ad8
Compare
Signed-off-by: Ansuman Sahoo <[email protected]>
9a25ad8
to
6beccf5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add unit tests for this newly created package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if !strings.HasPrefix(base, "lima-driver-") { | ||
return | ||
} | ||
|
||
name := strings.TrimPrefix(base, "lima-driver-") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can simplify (but I'm not sure without any tests):
if !strings.HasPrefix(base, "lima-driver-") { | |
return | |
} | |
name := strings.TrimPrefix(base, "lima-driver-") | |
name, ok := strings.CutPrefix(base, "lima-driver-") | |
if !ok { | |
return | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'm merging this, but please take a look at the review comments
This pull request introduces a driver registry for internal and external drivers and exposes driver information through the CLI. This change is a critical step towards a full plugin architecture, enabling the discovery of external drivers.
Key Changes
pkg/registry
package has been introduced. This package is responsible for discovering and managing available drivers, creating a centralized system that allows Lima to dynamically identify built-in and external driver plugins.limainfo
: Thelimainfo
data structure is now updated to include metadata about the driver whether it is built-in or external(with the location of the binary).limactl
command-line tool has been updated to leverage the new registry andlimainfo
fields. Users can now view the available drivers throughlimactl create --list-drivers
.GSoC Context
This is the 2nd of 4 PRs in the initial GSoC project submission. It is dependent on the merge of the #3691 and serves as a necessary prerequisite for the two remaining PRs to be merged.
Related Issues