Skip to content

Commit 204f0a8

Browse files
committed
Change default for mounts.sshfs.cache to true
This was changed to `false` in lima 0.8.0: * #538 It has generated multiple reports of breaking PHP package manager, unit tests, and file system access itself: * #556 * abiosoft/colima#129 * rancher-sandbox/rancher-desktop#1349 Signed-off-by: Jan Dubois <[email protected]>
1 parent fce1b2f commit 204f0a8

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

pkg/limayaml/default.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ mounts:
5050
sshfs:
5151
# Enabling the SSHFS cache will increase performance of the mounted filesystem, at
5252
# the cost of potentially not reflecting changes made on the host in a timely manner.
53-
# Default: false
53+
# Warning: It looks like PHP filesystem access does not work correctly when
54+
# the cache is disabled.
55+
# Default: true
5456
cache: null
5557
# SSHFS has an optional flag called 'follow_symlinks'. This allows mounts
5658
# to be properly resolved in the guest os and allow for access to the

pkg/limayaml/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
339339
for i := range y.Mounts {
340340
mount := &y.Mounts[i]
341341
if mount.SSHFS.Cache == nil {
342-
mount.SSHFS.Cache = pointer.Bool(false)
342+
mount.SSHFS.Cache = pointer.Bool(true)
343343
}
344344
if mount.SSHFS.FollowSymlinks == nil {
345345
mount.SSHFS.FollowSymlinks = pointer.Bool(false)

pkg/limayaml/defaults_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func TestFillDefault(t *testing.T) {
120120
expect := builtin
121121
expect.Mounts = y.Mounts
122122
expect.Mounts[0].Writable = pointer.Bool(false)
123-
expect.Mounts[0].SSHFS.Cache = pointer.Bool(false)
123+
expect.Mounts[0].SSHFS.Cache = pointer.Bool(true)
124124
expect.Mounts[0].SSHFS.FollowSymlinks = pointer.Bool(false)
125125
// Only missing Mounts field is Writable, and the default value is also the null value: false
126126

@@ -244,7 +244,7 @@ func TestFillDefault(t *testing.T) {
244244
expect = d
245245
// Also verify that archive arch is filled in
246246
expect.Containerd.Archives[0].Arch = *d.Arch
247-
expect.Mounts[0].SSHFS.Cache = pointer.Bool(false)
247+
expect.Mounts[0].SSHFS.Cache = pointer.Bool(true)
248248
expect.Mounts[0].SSHFS.FollowSymlinks = pointer.Bool(false)
249249

250250
y = LimaYAML{}
@@ -317,7 +317,7 @@ func TestFillDefault(t *testing.T) {
317317
Location: "/var/log",
318318
Writable: pointer.Bool(true),
319319
SSHFS: SSHFS{
320-
Cache: pointer.Bool(true),
320+
Cache: pointer.Bool(false),
321321
FollowSymlinks: pointer.Bool(true),
322322
},
323323
},
@@ -376,7 +376,7 @@ func TestFillDefault(t *testing.T) {
376376
// o.Mounts just makes d.Mounts[0] writable because the Location matches
377377
expect.Mounts = append(d.Mounts, y.Mounts...)
378378
expect.Mounts[0].Writable = pointer.Bool(true)
379-
expect.Mounts[0].SSHFS.Cache = pointer.Bool(true)
379+
expect.Mounts[0].SSHFS.Cache = pointer.Bool(false)
380380
expect.Mounts[0].SSHFS.FollowSymlinks = pointer.Bool(true)
381381

382382
// o.Networks[1] is overriding the d.Networks[0].Lima entry for the "def0" interface

0 commit comments

Comments
 (0)