Skip to content

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

Merged
merged 1 commit into from
Jul 11, 2025

Conversation

unsuman
Copy link
Contributor

@unsuman unsuman commented Jul 5, 2025

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

  • Driver Registry Implementation: A new 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.
  • Exposure of Plugin Info in limainfo: The limainfo data structure is now updated to include metadata about the driver whether it is built-in or external(with the location of the binary).
  • CLI Enhancements: The limactl command-line tool has been updated to leverage the new registry and limainfo fields. Users can now view the available drivers through limactl 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

@AkihiroSuda AkihiroSuda added the gsoc/2025 Google Summer of Code 2025 label Jul 7, 2025
@AkihiroSuda AkihiroSuda added this to the v2.0 (?) milestone Jul 7, 2025
@unsuman unsuman force-pushed the feature/driver-registry branch 3 times, most recently from f95e8b0 to bf3f567 Compare July 7, 2025 13:27
@unsuman unsuman force-pushed the feature/driver-registry branch 2 times, most recently from f94cfcf to 80dbaf2 Compare July 8, 2025 09:10
@unsuman unsuman force-pushed the feature/driver-registry branch 2 times, most recently from 2ab4f03 to 9a25ad8 Compare July 9, 2025 10:44
@unsuman unsuman force-pushed the feature/driver-registry branch from 9a25ad8 to 6beccf5 Compare July 9, 2025 11:46
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I add it under #3554 and another PR because it will require a mock diver and Register() function(see this) in order to test functions like Get(), registerDriverFile() etc?

Comment on lines +172 to +176
if !strings.HasPrefix(base, "lima-driver-") {
return
}

name := strings.TrimPrefix(base, "lima-driver-")
Copy link
Member

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):

Suggested change
if !strings.HasPrefix(base, "lima-driver-") {
return
}
name := strings.TrimPrefix(base, "lima-driver-")
name, ok := strings.CutPrefix(base, "lima-driver-")
if !ok {
return
}

Copy link
Member

@AkihiroSuda AkihiroSuda left a 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

@AkihiroSuda AkihiroSuda merged commit d16de8a into lima-vm:master Jul 11, 2025
114 of 117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc/2025 Google Summer of Code 2025
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose Plugin Information in CLI Implement Central Registry for Built-in Plugins
3 participants