internal/pkg: respect mount order for overlay temp

Setting it up after everything else prevents covering files in /tmp.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-07 01:03:49 +09:00
parent 3a21ba1bca
commit 54da6ce03d
2 changed files with 32 additions and 30 deletions

View File

@@ -144,22 +144,24 @@ func main() {
}
}
if overlayTmp {
next() // testtool artifact
if m.Root != "/" || m.Target != "/tmp" ||
m.Source != "overlay" || m.FsType != "overlay" {
log.Fatal("unexpected temp mount entry")
}
}
next()
if path.Base(m.Root) != ident || m.Target != "/work" {
log.Fatal("unexpected work mount entry")
}
next()
if !overlayTmp {
next()
if path.Base(m.Root) != ident || m.Target != "/tmp" {
log.Fatal("unexpected temp mount entry")
}
} else {
// testtool artifact
if m.Root != "/" || m.Target != "/tmp" ||
m.Source != "overlay" || m.FsType != "overlay" {
log.Fatal("unexpected temp mount entry")
}
}
next()