diff options
Diffstat (limited to 'container/initoverlay.go')
| -rw-r--r-- | container/initoverlay.go | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/container/initoverlay.go b/container/initoverlay.go index 0c31f8fd..2fec6364 100644 --- a/container/initoverlay.go +++ b/container/initoverlay.go @@ -54,8 +54,11 @@ func (e *OverlayArgumentError) Error() string { } } -// Overlay appends an [Op] that mounts the overlay pseudo filesystem on [MountOverlayOp.Target]. -func (f *Ops) Overlay(target, state, work *check.Absolute, layers ...*check.Absolute) *Ops { +// Overlay is a helper for appending [MountOverlayOp] to [Ops]. +func (f *Ops) Overlay( + target, state, work *check.Absolute, + layers ...*check.Absolute, +) *Ops { *f = append(*f, &MountOverlayOp{ Target: target, Lower: layers, @@ -65,13 +68,12 @@ func (f *Ops) Overlay(target, state, work *check.Absolute, layers ...*check.Abso return f } -// OverlayEphemeral appends an [Op] that mounts the overlay pseudo filesystem on [MountOverlayOp.Target] -// with an ephemeral upperdir and workdir. +// OverlayEphemeral appends a [MountOverlayOp] with an ephemeral upperdir and workdir. func (f *Ops) OverlayEphemeral(target *check.Absolute, layers ...*check.Absolute) *Ops { return f.Overlay(target, fhs.AbsRoot, nil, layers...) } -// OverlayReadonly appends an [Op] that mounts the overlay pseudo filesystem readonly on [MountOverlayOp.Target] +// OverlayReadonly appends a readonly [MountOverlayOp]. func (f *Ops) OverlayReadonly(target *check.Absolute, layers ...*check.Absolute) *Ops { return f.Overlay(target, nil, nil, layers...) } @@ -82,25 +84,34 @@ type MountOverlayOp struct { // Any filesystem, does not need to be on a writable filesystem. Lower []*check.Absolute - // formatted for [OptionOverlayLowerdir], resolved, prefixed and escaped during early + // Formatted for [OptionOverlayLowerdir]. + // + // Resolved, prefixed and escaped during early. lower []string + // The upperdir is normally on a writable filesystem. // - // If Work is nil and Upper holds the special value [fhs.AbsRoot], - // an ephemeral upperdir and workdir will be set up. + // If Work is nil and Upper holds the special value [fhs.AbsRoot], an + // ephemeral upperdir and workdir will be set up. // - // If both Work and Upper are nil, upperdir and workdir is omitted and the overlay is mounted readonly. + // If both Work and Upper are nil, upperdir and workdir is omitted and the + // overlay is mounted readonly. Upper *check.Absolute - // formatted for [OptionOverlayUpperdir], resolved, prefixed and escaped during early + // Formatted for [OptionOverlayUpperdir]. + // + // Resolved, prefixed and escaped during early. upper string + // The workdir needs to be an empty directory on the same filesystem as upperdir. Work *check.Absolute - // formatted for [OptionOverlayWorkdir], resolved, prefixed and escaped during early + // Formatted for [OptionOverlayWorkdir]. + // + // Resolved, prefixed and escaped during early. work string ephemeral bool - // used internally for mounting to the intermediate root + // Used internally for mounting to the intermediate root. noPrefix bool } |
