Documentation
¶
Index ¶
- func DetectVolumeMode() storage_v1alpha.DiskVolumeVolumeMode
- func ParseFilesystem(fs string) storage_v1alpha.DiskFilesystem
- type Resolver
- func (r *Resolver) CreateDiskAndVolume(ctx context.Context, name string, sizeBytes int64, filesystem string, ...) (*snapshot.RestoreTarget, error)
- func (r *Resolver) FindDisk(ctx context.Context, name string) (*snapshot.DiskState, error)
- func (r *Resolver) FindLeases(ctx context.Context, diskID string) ([]snapshot.LeaseState, error)
- func (r *Resolver) FindNodeId(ctx context.Context) (entity.Id, error)
- func (r *Resolver) FindVolume(ctx context.Context, diskID string) (*snapshot.VolumeState, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectVolumeMode ¶
func DetectVolumeMode() storage_v1alpha.DiskVolumeVolumeMode
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 New ¶
func New(eac *entityserver_v1alpha.EntityAccessClient, ec *entityserver.Client) *Resolver
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) FindLeases ¶
func (*Resolver) FindNodeId ¶
FindNodeId finds the coordinator node. Stateful sandboxes (those with disk volumes) run on the coordinator, so disk_volume entities must reference it.