fix(builder): don't count Docker's init or the Steam client's own files as lost saves
Every container the node-agent starts gets /usr/sbin/docker-init, and SteamCMD rewrites its own config.vdf on every run. Counted as files written outside the volumes, they made every build look like it loses saves. A folder whose only changes were logs no longer counts either, and a folder followed by a same-named file (worlds, worlds.bak) is no longer taken for a file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
87dfca1285
commit
0a80a6ebc5
4 files changed
+71
-43
No files matched your search
+2
-11
@@ -336,9 +336,6 @@ func closestVar(name string, vars []string) string {
|
||||
return best
|
||||
}
|
||||
|
||||
// Files the Steam client, Proton and the OS write for themselves: not the game's data
|
||||
var outsideNoise = []string{"/Steam/logs/", "/.steam/", "/steamcmd/", "/.cache/", "/tmp/", "/.local/share/umu"}
|
||||
|
||||
// savesOutsideVolumes turns first boot's "written outside the volumes" into a hard check: anything the
|
||||
// game itself wrote there (worlds or player lists under the user's home folder) is lost every time the
|
||||
// node recreates the container. A template passes once its startup command or settings point the game at
|
||||
@@ -372,14 +369,8 @@ func outsideDirs(report *bootReport) []string {
|
||||
}
|
||||
dirs := map[string]bool{}
|
||||
for _, c := range report.ContainerChanges {
|
||||
_, p, _ := strings.Cut(c, " ")
|
||||
noise := false
|
||||
for _, n := range outsideNoise {
|
||||
if strings.Contains(p, n) {
|
||||
noise = true
|
||||
}
|
||||
}
|
||||
if !noise && p != "" {
|
||||
// A report saved by an older version can still list files that aren't the game's state
|
||||
if _, p, _ := strings.Cut(c, " "); p != "" && !notGameState(p) {
|
||||
dirs[path.Dir(p)] = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user