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 ¶
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 ¶
MountPoint reports where the share is mounted in the guest.
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 ¶
UnmountAll tears down every live mount (best-effort; returns the first error). Call on agent shutdown.