cubefs

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package cubefs mounts a CubeFS volume inside the guest by driving the CubeFS FUSE client (cfs-client) — CubeFS being the platform's RWX share backend (a CNCF distributed POSIX + S3 filesystem, since it replaced the SFTP server). The mount is a real kernel FUSE mount, transparent to every guest process and (via bind-mounts) to containers.

cfs-client is itself a Go FUSE daemon ; we generate its config, exec it, and manage its lifetime in a Registry so dynamic event-bus updates can mount/unmount/replace by ID — the propagation path (pkg/mounts) is unchanged from the SFTP backend; only this engine differs.

Index

Constants

This section is empty.

Variables

View Source
var Binary = "cfs-client"

Binary is the cfs-client executable. The guest image / initrd provides it (CubeFS's client is Go). Overridable for tests / non-PATH installs.

Functions

This section is empty.

Types

type Mounted

type Mounted struct {
	// contains filtered or unexported fields
}

Mounted is a live CubeFS mount: the cfs-client process plus its mount point. Unmount detaches the FUSE mount and stops the client.

func Mount

func Mount(spec pod.ShareMount) (*Mounted, error)

Mount attaches the CubeFS volume described by spec at spec.MountPoint by launching cfs-client, and returns once the mount is live. spec must already be Validate()d by the caller.

func (*Mounted) MountPoint

func (m *Mounted) MountPoint() string

MountPoint reports where the share is mounted in the guest.

func (*Mounted) Unmount

func (m *Mounted) Unmount() error

Unmount detaches the FUSE mount then stops cfs-client. Best-effort: the kernel mount is removed even if stopping the process errs. Waits for the reaper goroutine so the process is fully reaped before the log file is closed.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry tracks live mounts by ShareMount.ID so dynamic updates can replace-by-ID or unmount idempotently. Safe for concurrent use by the event-bus apply callback.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Apply

func (r *Registry) Apply(spec pod.ShareMount) error

Apply reconciles one ShareMount against the registry: unmount on the unmount action, otherwise (re)mount, replacing any existing mount with the same ID. Idempotent — a repeated publish re-establishes the mount.

func (*Registry) UnmountAll

func (r *Registry) UnmountAll() error

UnmountAll tears down every live mount (best-effort; returns the first error). Call on agent shutdown.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL