Skip to content

A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps.

fix(settings): tune storage under load balance without shrinking it

ExTv41fc615da53c
diff --git a/app/src/main/java/com/excp/podroid/ui/screens/settings/SettingsViewModel.kt b/app/src/main/java/com/excp/podroid/ui/screens/settings/SettingsViewModel.kt
index c12a242..ea818d0 100644
--- a/app/src/main/java/com/excp/podroid/ui/screens/settings/SettingsViewModel.kt
+++ b/app/src/main/java/com/excp/podroid/ui/screens/settings/SettingsViewModel.kt
@@ -245,6 +245,11 @@ class SettingsViewModel @Inject constructor(
settingsRepository.setVmRamMb(profile.ramMb)
settingsRepository.setVmCpus(profile.cpus)
settingsRepository.setBandwidthMbps(profile.bandwidthMbps)
+ // The overlay image is grown to this setting and never shrunk, so a
+ // balanced size below the current one would only misreport the real
+ // image. Floor the balanced storage at the current size.
+ val current = settingsRepository.getStorageSizeGbSnapshot()
+ settingsRepository.setStorageSizeGb(maxOf(profile.storageGb, current))
}
}
}