hst/fs: rename method Target to Path
All checks were successful
Test / Create distribution (push) Successful in 32s
Test / Sandbox (push) Successful in 2m7s
Test / Hakurei (push) Successful in 3m7s
Test / Hpkg (push) Successful in 3m50s
Test / Sandbox (race detector) (push) Successful in 4m17s
Test / Hakurei (race detector) (push) Successful in 5m3s
Test / Flake checks (push) Successful in 1m27s

This allows adapter structs to use the same field names as Op structs.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-08-16 02:06:41 +09:00
parent 4ffeec3004
commit 8dd3e1ee5d
15 changed files with 152 additions and 152 deletions

View File

@@ -15,7 +15,7 @@ const FilesystemOverlay = "overlay"
// FSOverlay represents an overlay mount point.
type FSOverlay struct {
// mount point in container
Dst *container.Absolute `json:"dst"`
Target *container.Absolute `json:"dst"`
// any filesystem, does not need to be on a writable filesystem, must not be nil
Lower []*container.Absolute `json:"lower"`
@@ -26,7 +26,7 @@ type FSOverlay struct {
}
func (o *FSOverlay) Valid() bool {
if o == nil || o.Dst == nil {
if o == nil || o.Target == nil {
return false
}
@@ -43,11 +43,11 @@ func (o *FSOverlay) Valid() bool {
}
}
func (o *FSOverlay) Target() *container.Absolute {
func (o *FSOverlay) Path() *container.Absolute {
if !o.Valid() {
return nil
}
return o.Dst
return o.Target
}
func (o *FSOverlay) Host() []*container.Absolute {
@@ -68,9 +68,9 @@ func (o *FSOverlay) Apply(op *container.Ops) {
}
if o.Upper != nil && o.Work != nil { // rw
op.Overlay(o.Dst, o.Upper, o.Work, o.Lower...)
op.Overlay(o.Target, o.Upper, o.Work, o.Lower...)
} else { // ro
op.OverlayReadonly(o.Dst, o.Lower...)
op.OverlayReadonly(o.Target, o.Lower...)
}
}
@@ -86,13 +86,13 @@ func (o *FSOverlay) String() string {
if o.Upper != nil && o.Work != nil {
return "w*" + strings.Join(append([]string{
container.EscapeOverlayDataSegment(o.Dst.String()),
container.EscapeOverlayDataSegment(o.Target.String()),
container.EscapeOverlayDataSegment(o.Upper.String()),
container.EscapeOverlayDataSegment(o.Work.String())},
lower...), container.SpecialOverlayPath)
} else {
return "*" + strings.Join(append([]string{
container.EscapeOverlayDataSegment(o.Dst.String())},
container.EscapeOverlayDataSegment(o.Target.String())},
lower...), container.SpecialOverlayPath)
}
}