aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst/fsoverlay.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-07 20:06:26 +0900
committerOphestra <cat@gensokyo.uk>2025-10-07 20:57:58 +0900
commit0e6c1a50260de141c50bb50fd3f2b2bcf9a3fe64 (patch)
treedfe9c40ceb8c1be8d2728a2db9017bffef174d3d /hst/fsoverlay.go
parentd23b4dc9e64d3f00e746c65f3038a1a6de44b8f5 (diff)
container/check: move absolute pathname
This allows use of absolute pathname values without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/fsoverlay.go')
-rw-r--r--hst/fsoverlay.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/hst/fsoverlay.go b/hst/fsoverlay.go
index f3c2f373..2c2a195c 100644
--- a/hst/fsoverlay.go
+++ b/hst/fsoverlay.go
@@ -5,6 +5,7 @@ import (
"strings"
"hakurei.app/container"
+ "hakurei.app/container/check"
)
func init() { gob.Register(new(FSOverlay)) }
@@ -15,14 +16,14 @@ const FilesystemOverlay = "overlay"
// FSOverlay represents an overlay mount point.
type FSOverlay struct {
// mount point in container
- Target *container.Absolute `json:"dst"`
+ Target *check.Absolute `json:"dst"`
// any filesystem, does not need to be on a writable filesystem, must not be nil
- Lower []*container.Absolute `json:"lower"`
+ Lower []*check.Absolute `json:"lower"`
// the upperdir is normally on a writable filesystem, leave as nil to mount Lower readonly
- Upper *container.Absolute `json:"upper,omitempty"`
+ Upper *check.Absolute `json:"upper,omitempty"`
// the workdir needs to be an empty directory on the same filesystem as Upper, must not be nil if Upper is populated
- Work *container.Absolute `json:"work,omitempty"`
+ Work *check.Absolute `json:"work,omitempty"`
}
func (o *FSOverlay) Valid() bool {
@@ -43,18 +44,18 @@ func (o *FSOverlay) Valid() bool {
}
}
-func (o *FSOverlay) Path() *container.Absolute {
+func (o *FSOverlay) Path() *check.Absolute {
if !o.Valid() {
return nil
}
return o.Target
}
-func (o *FSOverlay) Host() []*container.Absolute {
+func (o *FSOverlay) Host() []*check.Absolute {
if !o.Valid() {
return nil
}
- p := make([]*container.Absolute, 0, 2+len(o.Lower))
+ p := make([]*check.Absolute, 0, 2+len(o.Lower))
if o.Upper != nil && o.Work != nil {
p = append(p, o.Upper, o.Work)
}