mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
fix(core): let a native host path follow a configured persistent path (#5777)
HostDefaultsConfigSource set floci.storage.host-persistent-path to the user
data directory as a fixed value. A persistent path set only in
config/application.yml then moved the state but not the directory child
containers bind. The host path now defaults to ${floci.storage.persistent-path},
so it follows whichever persistent path wins, and an explicit host path still
takes precedence.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
1 parent
e24a2882bc
commit
f897dfc3b6
2 files changed
+36
-3
No files matched your search
@@ -20,6 +20,7 @@ public class HostDefaultsConfigSource implements ConfigSource {
|
||||
static final int ORDINAL = 260;
|
||||
static final String PERSISTENT_PATH = "floci.storage.persistent-path";
|
||||
static final String HOST_PERSISTENT_PATH = "floci.storage.host-persistent-path";
|
||||
static final String FOLLOW_PERSISTENT_PATH = "${" + PERSISTENT_PATH + "}";
|
||||
|
||||
private final Map<String, String> properties;
|
||||
|
||||
@@ -30,8 +31,9 @@ public class HostDefaultsConfigSource implements ConfigSource {
|
||||
HostDefaultsConfigSource(boolean nativeOnHost) {
|
||||
if (nativeOnHost) {
|
||||
String dir = HostDataDir.persistentPathDefault();
|
||||
// The binary and Docker share the host filesystem, so child containers bind the same path.
|
||||
this.properties = Map.of(PERSISTENT_PATH, dir, HOST_PERSISTENT_PATH, dir);
|
||||
// The binary and Docker share the host filesystem, so child containers bind the same path,
|
||||
// including one the user sets in config/application.yml.
|
||||
this.properties = Map.of(PERSISTENT_PATH, dir, HOST_PERSISTENT_PATH, FOLLOW_PERSISTENT_PATH);
|
||||
} else {
|
||||
this.properties = Map.of();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user