Skip to content

Commit f020bd5

Browse files
committed
driver(internal): fix CI checks and lint errors
Signed-off-by: Ansuman Sahoo <[email protected]>
1 parent 54f1866 commit f020bd5

File tree

5 files changed

+10
-32
lines changed

5 files changed

+10
-32
lines changed

pkg/builtins/drivers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package builtins
55

66
import (
7+
// Import all built-in drivers to register them in the registry.
78
_ "github.com/lima-vm/lima/pkg/qemu"
89
_ "github.com/lima-vm/lima/pkg/vz"
910
_ "github.com/lima-vm/lima/pkg/wsl2"

pkg/driver/driver.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/lima-vm/lima/pkg/store"
1111
)
1212

13-
// Basic lifecycle operations
13+
// Lifecycle defines basic lifecycle operations.
1414
type Lifecycle interface {
1515
// Validate returns error if the current driver isn't support for given config
1616
Validate() error
@@ -36,7 +36,7 @@ type Lifecycle interface {
3636
Stop(_ context.Context) error
3737
}
3838

39-
// GUI-related operations
39+
// GUI defines GUI-related operations.
4040
type GUI interface {
4141
// CanRunGUI returns bool to indicate if the hostagent need to run GUI synchronously
4242
CanRunGUI() bool
@@ -49,21 +49,21 @@ type GUI interface {
4949
GetDisplayConnection(ctx context.Context) (string, error)
5050
}
5151

52-
// Snapshot operations
52+
// Snapshot defines operations for managing snapshots.
5353
type Snapshot interface {
5454
CreateSnapshot(ctx context.Context, tag string) error
5555
ApplySnapshot(ctx context.Context, tag string) error
5656
DeleteSnapshot(ctx context.Context, tag string) error
5757
ListSnapshots(ctx context.Context) (string, error)
5858
}
5959

60-
// Registration operations
60+
// Registration defines operations for registering and unregistering the driver instance.
6161
type Registration interface {
6262
Register(ctx context.Context) error
6363
Unregister(ctx context.Context) error
6464
}
6565

66-
// Guest agent operations
66+
// GuestAgent defines operations for the guest agent.
6767
type GuestAgent interface {
6868
// ForwardGuestAgent returns if the guest agent sock needs forwarding by host agent.
6969
ForwardGuestAgent() bool
@@ -76,7 +76,7 @@ type Plugin interface {
7676
// Name returns the name of the driver
7777
Name() string
7878

79-
// NewDriver returns a new driver instance. Only to be used to embed internal drivers
79+
// SetConfig sets the configuration for the instance.
8080
SetConfig(inst *store.Instance, sshLocalPort int)
8181
}
8282

pkg/driverutil/driverutil.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

pkg/driverutil/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/lima-vm/lima/pkg/store"
1212
)
1313

14-
// CreateTargetDriverInstance creates the appropriate driver for an instance
14+
// CreateTargetDriverInstance creates the appropriate driver for an instance.
1515
func CreateTargetDriverInstance(inst *store.Instance, sshLocalPort int) (driver.Driver, error) {
1616
limaDriver := inst.Config.VMType
1717
driver, exists := registry.DefaultRegistry.Get(string(*limaDriver))

pkg/limainfo/limainfo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99

1010
"github.com/sirupsen/logrus"
1111

12-
"github.com/lima-vm/lima/pkg/driverutil"
1312
"github.com/lima-vm/lima/pkg/limayaml"
13+
"github.com/lima-vm/lima/pkg/registry"
1414
"github.com/lima-vm/lima/pkg/store/dirnames"
1515
"github.com/lima-vm/lima/pkg/templatestore"
1616
"github.com/lima-vm/lima/pkg/usrlocalsharelima"
@@ -45,7 +45,7 @@ func New() (*LimaInfo, error) {
4545
info := &LimaInfo{
4646
Version: version.Version,
4747
DefaultTemplate: y,
48-
VMTypes: driverutil.AvailableDrivers(),
48+
VMTypes: registry.DefaultRegistry.List(),
4949
GuestAgents: make(map[limayaml.Arch]GuestAgent),
5050
}
5151
info.Templates, err = templatestore.Templates()

0 commit comments

Comments
 (0)