You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the MaxSnaps configuration option is set to 0 the following panic
occurs during installation:
```
[PANICKED] Test Panicked
In [It] at: /usr/lib64/go/1.24/src/runtime/panic.go:115 @ 07/01/25 10:04:57.47
runtime error: index out of range [0] with length 0
Full Stack Trace
github.com/rancher/elemental-toolkit/v2/pkg/snapshotter.(*LoopDevice).cleanOldSnapshots(0xc00025a300)
/home/frelon/src/elemental-toolkit/pkg/snapshotter/loopdevice.go:468 +0x3e7
github.com/rancher/elemental-toolkit/v2/pkg/snapshotter.(*LoopDevice).CloseTransaction(0xc00025a300, 0xc000234a00)
/home/frelon/src/elemental-toolkit/pkg/snapshotter/loopdevice.go:271 +0x11d5
github.com/rancher/elemental-toolkit/v2/pkg/snapshotter_test.init.func3.12()
/home/frelon/src/elemental-toolkit/pkg/snapshotter/loopdevice_test.go:204 +0x38e
```
This commit checks that we don't try to delete old snapshots in case
there are none.
Signed-off-by: Fredrik Lönnegren <[email protected]>
(cherry picked from commit d8450e0)
0 commit comments