volumehandlers

package
v0.0.0-...-1f5fa9c Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VolumeHandler

type VolumeHandler interface {
	// PrepareVolume handles preparation process
	PrepareVolume() error
	// HandlePrepared handles preparation done
	HandlePrepared() (bool, error)
	// CreateVolume handles creation process
	CreateVolume() (string, error)
	// HandleCreated handles creation done
	HandleCreated() (bool, error)
	// DestroyVolume handles destroy process
	DestroyVolume() (string, error)
	// Populate fills VolumeStatus with the information from previously created volume
	Populate() (bool, error)
	// GetVolumeDetails returns ActualSize, VirtualSize, Format, DirtyFlag and possible error
	GetVolumeDetails() (uint64, uint64, string, bool, error)
	// UsageFromStatus returns calculated usage of volume
	// with current options of VolumeStatus
	// to be used in storage usage calculation
	UsageFromStatus() uint64
	// CreateSnapshot handles snapshot creation process, returns snapshot metadata
	CreateSnapshot() (interface{}, time.Time, error)
	// RollbackToSnapshot handles rollback process
	RollbackToSnapshot(snapshotMeta interface{}) error
	// DeleteSnapshot handles snapshot deletion
	DeleteSnapshot(snapshotMeta interface{}) error
}

VolumeHandler implements processing of different volumes types

func GetVolumeHandler

func GetVolumeHandler(log *base.LogObject, volumeManager VolumeMgr, status *types.VolumeStatus) VolumeHandler

GetVolumeHandler returns handler based on provided status

func NewCSIHandler

func NewCSIHandler(common commonVolumeHandler, useVHost bool) VolumeHandler

NewCSIHandler in this file is just stub for non-kubevirt hypervisors.

type VolumeMgr

type VolumeMgr interface {
	LookupVolumeConfig(key string) *types.VolumeConfig
	LookupVolumeStatus(key string) *types.VolumeStatus
	LookupContentTreeStatus(key string) *types.ContentTreeStatus
	LookupBlobStatus(blobSha string) *types.BlobStatus
	LookupZVolStatusByDataset(dataset string) *types.ZVolStatus
	GetCapabilities() *types.Capabilities
	GetCasClient() cas.CAS
}

VolumeMgr is an interface to obtain information required for volume processing

Jump to

Keyboard shortcuts

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