Skip to content

Commit b690b21

Browse files
committed
driver(external): move proxy conn code to driver level
Signed-off-by: Ansuman Sahoo <[email protected]>
1 parent cd92ddb commit b690b21

File tree

15 files changed

+207
-193
lines changed

15 files changed

+207
-193
lines changed

pkg/driver/driver.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,10 @@ type Info struct {
9090
VirtioPort string `json:"virtioPort"`
9191
InstanceDir string `json:"instanceDir,omitempty"`
9292
}
93+
94+
type DriverType = string
95+
96+
const (
97+
DriverTypeInternal DriverType = "internal"
98+
DriverTypeExternal DriverType = "external"
99+
)

pkg/driver/external/client/methods.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
"net"
1111
"time"
1212

13-
// "google.golang.org/protobuf/proto"
14-
1513
"google.golang.org/protobuf/types/known/emptypb"
1614

1715
"github.com/lima-vm/lima/pkg/driver"
@@ -252,19 +250,13 @@ func (d *DriverClient) ForwardGuestAgent() bool {
252250

253251
func (d *DriverClient) GuestAgentConn(ctx context.Context) (net.Conn, error) {
254252
d.logger.Info("Getting guest agent connection")
255-
resp, err := d.DriverSvc.GuestAgentConn(ctx, &emptypb.Empty{})
253+
_, err := d.DriverSvc.GuestAgentConn(ctx, &emptypb.Empty{})
256254
if err != nil {
257255
d.logger.Errorf("Failed to get guest agent connection: %v", err)
258256
return nil, err
259257
}
260258

261-
var nd net.Dialer
262-
unixConn, err := nd.DialContext(ctx, "unix", resp.SocketPath)
263-
if err != nil {
264-
d.logger.Errorf("Failed to connect to guest agent socket %s: %v", resp.SocketPath, err)
265-
return nil, err
266-
}
267-
return unixConn, nil
259+
return nil, nil
268260
}
269261

270262
func (d *DriverClient) GetInfo() driver.Info {

0 commit comments

Comments
 (0)