hst: support ephemeral overlay mounts
Test / Create distribution (push) Successful in 55s
Test / Sandbox (push) Successful in 2m41s
Test / ShareFS (push) Successful in 3m47s
Test / Hakurei (push) Successful in 3m59s
Test / Sandbox (race detector) (push) Successful in 5m33s
Test / Hakurei (race detector) (push) Successful in 6m38s
Test / Flake checks (push) Successful in 1m13s

This is useful for reusing a readonly template without autoroot.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-06-17 02:16:57 +09:00
parent 28e133c298
commit 92b61889a6
6 changed files with 59 additions and 12 deletions
+7 -2
View File
@@ -3,6 +3,7 @@ package hst_test
import (
"encoding/json"
"errors"
"fmt"
"os"
"reflect"
"strings"
@@ -283,11 +284,11 @@ func checkFs(t *testing.T, testCases []fsTestCase) {
if !reflect.DeepEqual(ops, &tc.ops) {
gotString := new(strings.Builder)
for _, op := range *ops {
gotString.WriteString("\n" + op.String())
gotString.WriteString("\n" + fmt.Sprintf("%#v", op))
}
wantString := new(strings.Builder)
for _, op := range tc.ops {
wantString.WriteString("\n" + op.String())
wantString.WriteString("\n" + fmt.Sprintf("%#v", op))
}
t.Errorf("Apply: %s, want %s", gotString, wantString)
}
@@ -339,6 +340,10 @@ func (p opsAdapter) Overlay(target, state, work *check.Absolute, layers ...*chec
return opsAdapter{p.Ops.Overlay(target, state, work, layers...)}
}
func (p opsAdapter) OverlayEphemeral(target *check.Absolute, layers ...*check.Absolute) hst.Ops {
return opsAdapter{p.Ops.OverlayEphemeral(target, layers...)}
}
func (p opsAdapter) OverlayReadonly(target *check.Absolute, layers ...*check.Absolute) hst.Ops {
return opsAdapter{p.Ops.OverlayReadonly(target, layers...)}
}