hst/fs: interface filesystem config
All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 2m14s
Test / Hakurei (push) Successful in 3m37s
Test / Hpkg (push) Successful in 4m27s
Test / Sandbox (race detector) (push) Successful in 4m23s
Test / Hakurei (race detector) (push) Successful in 5m22s
Test / Flake checks (push) Successful in 1m22s

This allows mount points to be represented by different underlying structs.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-08-12 04:38:45 +09:00
parent e99d7affb0
commit 99ac96511b
22 changed files with 927 additions and 223 deletions

View File

@@ -128,42 +128,11 @@ func printShowInstance(
if config.Container != nil && len(config.Container.Filesystem) > 0 {
t.Printf("Filesystem\n")
for _, f := range config.Container.Filesystem {
g := 4
if f.Src == nil {
if !f.Valid() {
t.Println(" <invalid>")
continue
} else {
g += len(f.Src.String())
}
if f.Dst != nil {
g += len(f.Dst.String())
}
expr := new(strings.Builder)
expr.Grow(g)
if f.Device {
expr.WriteString(" d")
} else if f.Write {
expr.WriteString(" w")
} else {
expr.WriteString(" ")
}
if f.Must {
expr.WriteString("*")
} else {
expr.WriteString("+")
}
src := f.Src.String()
if src != container.Nonexistent {
expr.WriteString(src)
} else {
expr.WriteString("tmpfs")
}
if f.Dst != nil {
expr.WriteString(":" + f.Dst.String())
}
t.Printf("%s\n", expr.String())
t.Printf(" %s\n", f)
}
t.Printf("\n")
}