Skip to content

Commit fe6621b

Browse files
committed
Enable gRPC port forwarder by default again
Fix issue 3046 The behavior can be rolled by setting `LIMA_SSH_PORT_FORWARDER=true` Signed-off-by: Akihiro Suda <[email protected]>
1 parent a2adc81 commit fe6621b

File tree

5 files changed

+31
-16
lines changed

5 files changed

+31
-16
lines changed

Diff for: .github/workflows/test.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,8 @@ jobs:
445445
strategy:
446446
fail-fast: false
447447
matrix:
448-
include:
449-
- {template: default.yaml, ssh-port-forwarder: true} # SSH port forwarder is currently still the default
450-
- {template: fedora.yaml, ssh-port-forwarder: false} # gRPC port forwarder will become default in the future
448+
template:
449+
- default.yaml
451450
steps:
452451
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
453452
with:
@@ -469,8 +468,6 @@ jobs:
469468
run: brew uninstall --ignore-dependencies --force qemu
470469
- name: Test
471470
run: ./hack/test-templates.sh templates/${{ matrix.template }}
472-
env:
473-
LIMA_SSH_PORT_FORWARDER: ${{ matrix.ssh-port-forwarder }}
474471
- if: failure()
475472
uses: ./.github/actions/upload_failure_logs_if_exists
476473
with:

Diff for: pkg/hostagent/hostagent.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type HostAgent struct {
5353
instName string
5454
instSSHAddress string
5555
sshConfig *ssh.SSHConfig
56-
portForwarder *portForwarder
56+
portForwarder *portForwarder // legacy SSH port forwarder (deprecated)
5757
grpcPortForwarder *portfwd.Forwarder
5858

5959
onClose []func() error // LIFO
@@ -644,9 +644,12 @@ func (a *HostAgent) processGuestAgentEvents(ctx context.Context, client *guestag
644644
for _, f := range ev.Errors {
645645
logrus.Warnf("received error from the guest: %q", f)
646646
}
647-
// useSSHFwd was false by default in v1.0, but reverted to true by default in v1.0.1
648-
// due to stability issues
649-
useSSHFwd := true
647+
// History of the default value of useSSHFwd:
648+
// - v0.1.0: true (effectively)
649+
// - v1.0.0: false
650+
// - v1.0.1: true
651+
// - v1.1.0-beta.0: false
652+
useSSHFwd := false
650653
if envVar := os.Getenv("LIMA_SSH_PORT_FORWARDER"); envVar != "" {
651654
b, err := strconv.ParseBool(os.Getenv("LIMA_SSH_PORT_FORWARDER"))
652655
if err != nil {
@@ -656,6 +659,7 @@ func (a *HostAgent) processGuestAgentEvents(ctx context.Context, client *guestag
656659
}
657660
}
658661
if useSSHFwd {
662+
logrus.Warn("LIMA_SSH_PORT_FORWARDER is deprecated")
659663
a.portForwarder.OnEvent(ctx, ev)
660664
} else {
661665
a.grpcPortForwarder.OnEvent(ctx, client, ev)

Diff for: website/content/en/docs/config/environment-variables.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,20 @@ This page documents the environment variables used in Lima.
4949

5050
### `LIMA_SSH_PORT_FORWARDER`
5151

52-
- **Description**: Specifies to use the SSH port forwarder (slow, stable) instead of gRPC (fast, unstable)
53-
- **Default**: `true`
52+
- **Description**: Specifies to use the SSH port forwarder (slow) instead of gRPC (fast, previously unstable)
53+
- **Default**: `false` (since v1.1.0-beta.0)
5454
- **Usage**:
5555
```sh
5656
export LIMA_SSH_PORT_FORWARDER=false
5757
```
58-
- **Note**: It is expected that this variable will be set to `false` by default in future
59-
when the gRPC port forwarder is well matured.
58+
- **Note**: Deprecated since v1.1. It is expected that this variable will be removed in future.
59+
- **The history of the default value**:
60+
| Version | Default value |
61+
|---------------|---------------------|
62+
| v0.1.0 | `true`, effectively |
63+
| v1.0.0 | `false` |
64+
| v1.0.1 | `true` |
65+
| v1.1.0-beta.0 | `false` |
6066

6167
### `LIMA_USERNET_RESOLVE_IP_ADDRESS_TIMEOUT`
6268

Diff for: website/content/en/docs/config/port.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,21 @@ Lima supports automatic port-forwarding of localhost ports from guest to host.
99

1010
Lima supports two port forwarders: SSH and GRPC.
1111

12-
The default port forwarder is SSH.
12+
The default port forwarder is shown in the following table.
13+
14+
| Version | Default |
15+
| ------------- | ------- |
16+
| v0.1.0 | SSH |
17+
| v1.0.0 | GRPC |
18+
| v1.0.1 | SSH |
19+
| v1.1.0-beta.0 | GRPC |
1320

1421
The default was once changed to GRPC in Lima v1.0, but it was reverted to SSH in v1.0.1 due to stability reasons.
15-
In future, it is expected that GRPC will take over the default position again.
22+
The default was further reverted to GRPC in Lima v1.1, as the stability issues were resolved.
1623

1724
### Using SSH
1825

19-
SSH based port forwarding is the default and current model that is supported in Lima.
26+
SSH based port forwarding is the legacy mode that was previously default.
2027

2128
To explicitly use SSH forwarding use the below command
2229

Diff for: website/content/en/docs/releases/deprecated.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The following features are deprecated:
88
- CentOS 7 support
99
- Loading non-strict YAMLs (i.e., YAMLs with unknown properties)
1010
- `limactl show-ssh` command (Use `ssh -F ~/.lima/default/ssh.config lima-default` instead)
11+
- `LIMA_SSH_PORT_FORWARDER=true` (since Lima v1.1)
1112

1213
## Removed features
1314
- YAML property `network`: deprecated in [Lima v0.7.0](https://github.com/lima-vm/lima/commit/07e68230e70b21108d2db3ca5e0efd0e43842fbd)

0 commit comments

Comments
 (0)