package filesystem
import "github.com/containerd/nydus-snapshotter/pkg/filesystem"
Index ¶
- type Filesystem
- func NewFileSystem(ctx context.Context, opt ...NewFSOpt) (*Filesystem, error)
- func (fs *Filesystem) BootstrapFile(id string) (string, error)
- func (fs *Filesystem) CacheUsage(ctx context.Context, blobDigest string) (snapshots.Usage, error)
- func (fs *Filesystem) CheckReferrer(ctx context.Context, labels map[string]string) bool
- func (fs *Filesystem) DetachTarfsLayer(snapshotID string) error
- func (fs *Filesystem) ExportBlockData(s storage.Snapshot, perLayer bool, labels map[string]string, storageLocater func(string) string) ([]string, error)
- func (fs *Filesystem) GetDaemonByID(id string) (*daemon.Daemon, error)
- func (fs *Filesystem) GetTarfsImageDiskFilePath(id string) (string, error)
- func (fs *Filesystem) GetTarfsLayerDiskFilePath(id string) (string, error)
- func (fs *Filesystem) IsStargzDataLayer(labels map[string]string) (bool, *stargz.Blob)
- func (fs *Filesystem) MergeStargzMetaLayer(ctx context.Context, s storage.Snapshot) error
- func (fs *Filesystem) MergeTarfsLayers(s storage.Snapshot, storageLocater func(string) string) error
- func (fs *Filesystem) Mount(ctx context.Context, snapshotID string, labels map[string]string, s *storage.Snapshot) (err error)
- func (fs *Filesystem) MountPoint(snapshotID string) (string, error)
- func (fs *Filesystem) PrepareStargzMetaLayer(blob *stargz.Blob, storagePath string, _ map[string]string) error
- func (fs *Filesystem) PrepareTarfsLayer(ctx context.Context, labels map[string]string, snapshotID, upperDirPath string) error
- func (fs *Filesystem) ReferrerDetectEnabled() bool
- func (fs *Filesystem) RemoveCache(blobDigest string) error
- func (fs *Filesystem) StargzEnabled() bool
- func (fs *Filesystem) StargzLayer(labels map[string]string) bool
- func (fs *Filesystem) TarfsEnabled() bool
- func (fs *Filesystem) Teardown(ctx context.Context) error
- func (fs *Filesystem) TryFetchMetadata(ctx context.Context, labels map[string]string, metadataPath string) error
- func (fs *Filesystem) TryRetainSharedDaemon(d *daemon.Daemon)
- func (fs *Filesystem) TryStopSharedDaemon()
- func (fs *Filesystem) Umount(_ context.Context, snapshotID string) error
- func (fs *Filesystem) UpperPath(id string) string
- func (fs *Filesystem) WaitUntilReady(snapshotID string) error
- type NewFSOpt
- func WithCacheManager(cm *cache.Manager) NewFSOpt
- func WithEnableStargz(enable bool) NewFSOpt
- func WithManagers(managers []*manager.Manager) NewFSOpt
- func WithNydusImageBinaryPath(p string) NewFSOpt
- func WithReferrerManager(rm *referrer.Manager) NewFSOpt
- func WithRootMountpoint(mountpoint string) NewFSOpt
- func WithTarfsManager(tm *tarfs.Manager) NewFSOpt
- func WithVerifier(verifier *signature.Verifier) NewFSOpt
Types ¶
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
func NewFileSystem ¶
func NewFileSystem(ctx context.Context, opt ...NewFSOpt) (*Filesystem, error)
NewFileSystem initialize Filesystem instance It does mount image layers by starting nydusd doing FUSE mount or not.
func (*Filesystem) BootstrapFile ¶
func (fs *Filesystem) BootstrapFile(id string) (string, error)
func (*Filesystem) CacheUsage ¶
How much space the layer/blob cache filesystem is occupying The blob digest mush have `sha256:` prefixed, otherwise, throw errors.
func (*Filesystem) CheckReferrer ¶
func (*Filesystem) DetachTarfsLayer ¶
func (fs *Filesystem) DetachTarfsLayer(snapshotID string) error
func (*Filesystem) ExportBlockData ¶
func (fs *Filesystem) ExportBlockData(s storage.Snapshot, perLayer bool, labels map[string]string, storageLocater func(string) string) ([]string, error)
func (*Filesystem) GetDaemonByID ¶
func (fs *Filesystem) GetDaemonByID(id string) (*daemon.Daemon, error)
func (*Filesystem) GetTarfsImageDiskFilePath ¶
func (fs *Filesystem) GetTarfsImageDiskFilePath(id string) (string, error)
func (*Filesystem) GetTarfsLayerDiskFilePath ¶
func (fs *Filesystem) GetTarfsLayerDiskFilePath(id string) (string, error)
func (*Filesystem) IsStargzDataLayer ¶
Detect if the blob is type of estargz by downloading its footer since estargz image does not have any characteristic annotation.
func (*Filesystem) MergeStargzMetaLayer ¶
func (*Filesystem) MergeTarfsLayers ¶
func (fs *Filesystem) MergeTarfsLayers(s storage.Snapshot, storageLocater func(string) string) error
func (*Filesystem) Mount ¶
func (fs *Filesystem) Mount(ctx context.Context, snapshotID string, labels map[string]string, s *storage.Snapshot) (err error)
Mount will be called when containerd snapshotter prepare remote snapshotter this method will fork nydus daemon and manage it in the internal store, and indexed by snapshotID It must set up all necessary resources during Mount procedure and revoke any step if necessary.
func (*Filesystem) MountPoint ¶
func (fs *Filesystem) MountPoint(snapshotID string) (string, error)
func (*Filesystem) PrepareStargzMetaLayer ¶
func (fs *Filesystem) PrepareStargzMetaLayer(blob *stargz.Blob, storagePath string, _ map[string]string) error
Generate nydus bootstrap from stargz layers Download estargz TOC part from each layer as `nydus-image` conversion source. After conversion, a nydus metadata or bootstrap is used to pointing to each estargz blob
func (*Filesystem) PrepareTarfsLayer ¶
func (fs *Filesystem) PrepareTarfsLayer(ctx context.Context, labels map[string]string, snapshotID, upperDirPath string) error
func (*Filesystem) ReferrerDetectEnabled ¶
func (fs *Filesystem) ReferrerDetectEnabled() bool
func (*Filesystem) RemoveCache ¶
func (fs *Filesystem) RemoveCache(blobDigest string) error
func (*Filesystem) StargzEnabled ¶
func (fs *Filesystem) StargzEnabled() bool
func (*Filesystem) StargzLayer ¶
func (fs *Filesystem) StargzLayer(labels map[string]string) bool
func (*Filesystem) TarfsEnabled ¶
func (fs *Filesystem) TarfsEnabled() bool
func (*Filesystem) Teardown ¶
func (fs *Filesystem) Teardown(ctx context.Context) error
Try to stop all the running daemons if they are not referenced by any snapshots Clean up resources along with the daemons.
func (*Filesystem) TryFetchMetadata ¶
func (fs *Filesystem) TryFetchMetadata(ctx context.Context, labels map[string]string, metadataPath string) error
func (*Filesystem) TryRetainSharedDaemon ¶
func (fs *Filesystem) TryRetainSharedDaemon(d *daemon.Daemon)
func (*Filesystem) TryStopSharedDaemon ¶
func (fs *Filesystem) TryStopSharedDaemon()
func (*Filesystem) Umount ¶
func (fs *Filesystem) Umount(_ context.Context, snapshotID string) error
func (*Filesystem) UpperPath ¶
func (fs *Filesystem) UpperPath(id string) string
func (*Filesystem) WaitUntilReady ¶
func (fs *Filesystem) WaitUntilReady(snapshotID string) error
WaitUntilReady wait until daemon ready by snapshotID, it will wait until nydus domain socket established and the status of nydusd daemon must be ready
type NewFSOpt ¶
type NewFSOpt func(d *Filesystem) error
func WithCacheManager ¶
func WithEnableStargz ¶
func WithManagers ¶
func WithNydusImageBinaryPath ¶
func WithReferrerManager ¶
func WithRootMountpoint ¶
func WithTarfsManager ¶
func WithVerifier ¶
Source Files ¶
config.go fs.go referer_adaptor.go stargz_adaptor.go tarfs_adaptor.go
- Version
- v0.15.2 (latest)
- Published
- May 26, 2025
- Platform
- linux/amd64
- Imports
- 33 packages
- Last checked
- 18 hours ago –
Tools for package owners.