diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-16 02:06:41 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-16 02:06:41 +0900 |
| commit | 8dd3e1ee5d10c150f58e3b49771d3ca847f6d4cf (patch) | |
| tree | 08c0c6812d34da419cd06323073989fb7b8d0c21 /hst/fsephemeral.go | |
| parent | 4ffeec3004607b76f73e504da220a1490c598348 (diff) | |
hst/fs: rename method Target to Path
This allows adapter structs to use the same field names as Op structs.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/fsephemeral.go')
| -rw-r--r-- | hst/fsephemeral.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/hst/fsephemeral.go b/hst/fsephemeral.go index 0ed50874..424a058d 100644 --- a/hst/fsephemeral.go +++ b/hst/fsephemeral.go @@ -16,7 +16,7 @@ const FilesystemEphemeral = "ephemeral" // FSEphemeral represents an ephemeral container mount point. type FSEphemeral struct { // mount point in container - Dst *container.Absolute `json:"dst,omitempty"` + Target *container.Absolute `json:"dst,omitempty"` // do not mount filesystem read-only Write bool `json:"write,omitempty"` // upper limit on the size of the filesystem @@ -25,13 +25,13 @@ type FSEphemeral struct { Perm os.FileMode `json:"perm,omitempty"` } -func (e *FSEphemeral) Valid() bool { return e != nil && e.Dst != nil } +func (e *FSEphemeral) Valid() bool { return e != nil && e.Target != nil } -func (e *FSEphemeral) Target() *container.Absolute { +func (e *FSEphemeral) Path() *container.Absolute { if !e.Valid() { return nil } - return e.Dst + return e.Target } func (e *FSEphemeral) Host() []*container.Absolute { return nil } @@ -54,9 +54,9 @@ func (e *FSEphemeral) Apply(ops *container.Ops) { } if e.Write { - ops.Tmpfs(e.Dst, size, perm) + ops.Tmpfs(e.Target, size, perm) } else { - ops.Readonly(e.Dst, perm) + ops.Readonly(e.Target, perm) } } @@ -66,7 +66,7 @@ func (e *FSEphemeral) String() string { } expr := new(strings.Builder) - expr.Grow(15 + len(FilesystemEphemeral) + len(e.Dst.String())) + expr.Grow(15 + len(FilesystemEphemeral) + len(e.Target.String())) if e.Write { expr.WriteString("w") @@ -77,7 +77,7 @@ func (e *FSEphemeral) String() string { } else { expr.WriteString(fsEphemeralDefaultPerm.String()) } - expr.WriteString("):" + e.Dst.String()) + expr.WriteString("):" + e.Target.String()) return expr.String() } |
