Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pkg/machine/gvproxy/gvproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)

func Start(ctx context.Context, mc *vmconfig.MachineConfig) error {
if err := system.KillExpectProcNameFromPPIDFile(mc.PIDFiles.GvproxyPidFile, define.GvProxyBinaryName); err != nil {

Check failure on line 27 in pkg/machine/gvproxy/gvproxy.go

View workflow job for this annotation

GitHub Actions / lint

avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
logrus.Warnf("kill old gvproxy from pid process failed: %v", err)
}

Expand All @@ -32,9 +32,13 @@
if err != nil {
return fmt.Errorf("unable to get gvproxy binary path: %w", err)
}

gvpCmd := gvproxyTypes.NewGvproxyCommand()
gvpCmd.SSHPort = mc.SSH.Port

if err := mc.GetSSHPort(); err != nil {

Check failure on line 38 in pkg/machine/gvproxy/gvproxy.go

View workflow job for this annotation

GitHub Actions / lint

avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
return fmt.Errorf("unable to get available ssh port: %w", err)
}

// gvproxy listen a local socks file as Podman API socks (PodmanSocks.InHost)
// and forward to the guest's Podman API socks(PodmanSocks.InGuest).
gvpCmd.AddForwardSock(mc.PodmanSocks.InHost)
Expand All @@ -46,7 +50,7 @@
// gvproxy endpoint, which provide network backend for vfkit/krunkit
gvpEndPoint := fs.NewFile(mc.GetNetworkStackEndpoint())

if err := gvpEndPoint.DeleteInDir(vmconfig.Workspace); err != nil {

Check failure on line 53 in pkg/machine/gvproxy/gvproxy.go

View workflow job for this annotation

GitHub Actions / lint

avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
return fmt.Errorf("unable to remove gvproxy endpoint file: %w", err)
}
gvpCmd.AddVfkitSocket(fmt.Sprintf("unixgram://%s", gvpEndPoint.GetPath()))
Expand All @@ -66,7 +70,7 @@

logrus.Infof("gvproxy full cmdline: %q", cmd.Args)
events.NotifyRun(events.StartGvProxy)
if err := cmd.Start(); err != nil {

Check failure on line 73 in pkg/machine/gvproxy/gvproxy.go

View workflow job for this annotation

GitHub Actions / lint

avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
return fmt.Errorf("unable to execute: %q: %w", cmd.Args, err)
}

Expand Down
Loading