diskresolve

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFilesystem

func ParseFilesystem(fs string) storage_v1alpha.DiskFilesystem

ParseFilesystem maps a filesystem name onto the disk enum, tolerating the "filesystem." prefix the enum renders with. Anything unrecognized becomes ext4, which is the default a disk gets when it does not ask for one.

Types

type Resolver

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

Resolver implements snapshot.DiskResolver using the entity access RPC client.

func (*Resolver) CreateDiskAndVolume

func (r *Resolver) CreateDiskAndVolume(ctx context.Context, name string, sizeBytes int64, filesystem string, dataPath string) (*snapshot.RestoreTarget, error)

CreateDiskAndVolume creates a new disk entity in RESTORING state so the disk controller ignores it while restore writes the image. The returned RestoreTarget includes a Finalize callback that creates the disk_volume entity and hands the disk to the controller as PROVISIONING, which promotes it once the volume is ready.

func (*Resolver) FindDisk

func (r *Resolver) FindDisk(ctx context.Context, name string) (*snapshot.DiskState, error)

func (*Resolver) FindLeases

func (r *Resolver) FindLeases(ctx context.Context, diskID string) ([]snapshot.LeaseState, error)

func (*Resolver) FindNodeId

func (r *Resolver) FindNodeId(ctx context.Context) (entity.Id, error)

FindNodeId finds the coordinator node. Stateful sandboxes (those with disk volumes) run on the coordinator, so disk_volume entities must reference it.

func (*Resolver) FindVolume

func (r *Resolver) FindVolume(ctx context.Context, diskID string) (*snapshot.VolumeState, error)

Jump to

Keyboard shortcuts

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