hst/fs: valid method on underlying interface

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-08-14 21:36:22 +09:00
parent c989e7785a
commit 0e543a58b3
6 changed files with 38 additions and 22 deletions

View File

@@ -13,6 +13,8 @@ import (
type FilesystemConfig interface {
// Type returns the type of this mount point.
Type() string
// Valid returns whether the configuration is valid.
Valid() bool
// Target returns the pathname of the mount point in the container.
Target() *container.Absolute
// Host returns a slice of all host paths used by this mount point.
@@ -60,7 +62,9 @@ type FilesystemConfigJSON struct {
}
// Valid returns whether the [FilesystemConfigJSON] is valid.
func (f *FilesystemConfigJSON) Valid() bool { return f != nil && f.FilesystemConfig != nil }
func (f *FilesystemConfigJSON) Valid() bool {
return f != nil && f.FilesystemConfig != nil && f.FilesystemConfig.Valid()
}
func (f *FilesystemConfigJSON) MarshalJSON() ([]byte, error) {
if f == nil || f.FilesystemConfig == nil {