fake

package
v19.10.1+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MinimumVolumeSizeBytes = 1048576 // 1 MiB

	// Constants for internal pool attributes
	Size   = "size"
	Region = "region"
	Zone   = "zone"
)

Variables

This section is empty.

Functions

func Clone

func Clone(a, b interface{})

func NewFakeStorageBackend

func NewFakeStorageBackend(configJSON string) (sb *storage.Backend, err error)

func NewFakeStorageDriverConfigJSON

func NewFakeStorageDriverConfigJSON(
	name string, protocol tridentconfig.Protocol, pools map[string]*fake.StoragePool, volumes []fake.Volume,
) (string, error)

func NewFakeStorageDriverConfigJSONWithVirtualPools

func NewFakeStorageDriverConfigJSONWithVirtualPools(
	name string, protocol tridentconfig.Protocol, pools map[string]*fake.StoragePool,
	vpool drivers.FakeStorageDriverPool, vpools []drivers.FakeStorageDriverPool,
) (string, error)

Types

type StorageDriver

type StorageDriver struct {
	Config drivers.FakeStorageDriverConfig

	// Volumes saves info about Volumes created on this driver
	Volumes map[string]fake.Volume

	// DestroyedVolumes is here so that tests can check whether destroy
	// has been called on a volume during or after bootstrapping, since
	// different driver instances with the same config won't actually share
	// state.
	DestroyedVolumes map[string]bool

	// Snapshots saves info about Snapshots created on this driver
	Snapshots map[string]map[string]*storage.Snapshot // map[volumeName]map[snapshotName]snapshot

	// DestroyedSnapshots is here so that tests can check whether delete
	// has been called on a snapshot during or after bootstrapping, since
	// different driver instances with the same config won't actually share
	// state.
	DestroyedSnapshots map[string]bool
	// contains filtered or unexported fields
}

func NewFakeStorageDriver

func NewFakeStorageDriver(config drivers.FakeStorageDriverConfig) *StorageDriver

func (*StorageDriver) BootstrapSnapshot

func (d *StorageDriver) BootstrapSnapshot(snapshot *storage.Snapshot)

func (*StorageDriver) BootstrapVolume

func (d *StorageDriver) BootstrapVolume(volume *storage.Volume)

func (StorageDriver) CopyVolumes

func (d StorageDriver) CopyVolumes(volumes map[string]fake.Volume)

CopyVolumes copies Volumes into this instance; there is no "storage system of truth" to use

func (*StorageDriver) Create

func (d *StorageDriver) Create(
	volConfig *storage.VolumeConfig, storagePool *storage.Pool, volAttributes map[string]sa.Request,
) error

func (*StorageDriver) CreateClone

func (d *StorageDriver) CreateClone(volConfig *storage.VolumeConfig) error

func (*StorageDriver) CreateFollowup

func (d *StorageDriver) CreateFollowup(volConfig *storage.VolumeConfig) error

func (*StorageDriver) CreatePrepare

func (d *StorageDriver) CreatePrepare(volConfig *storage.VolumeConfig) error

func (*StorageDriver) CreateSnapshot

func (d *StorageDriver) CreateSnapshot(snapConfig *storage.SnapshotConfig) (*storage.Snapshot, error)

CreateSnapshot creates a snapshot for the given volume

func (*StorageDriver) DeleteSnapshot

func (d *StorageDriver) DeleteSnapshot(snapConfig *storage.SnapshotConfig) error

DeleteSnapshot creates a snapshot of a volume.

func (*StorageDriver) Destroy

func (d *StorageDriver) Destroy(name string) error

func (*StorageDriver) Get

func (d *StorageDriver) Get(name string) error

func (*StorageDriver) GetExternalConfig

func (d *StorageDriver) GetExternalConfig() interface{}

func (*StorageDriver) GetInternalVolumeName

func (d *StorageDriver) GetInternalVolumeName(name string) string

func (*StorageDriver) GetProtocol

func (d *StorageDriver) GetProtocol() tridentconfig.Protocol

func (*StorageDriver) GetSnapshot

func (d *StorageDriver) GetSnapshot(snapConfig *storage.SnapshotConfig) (*storage.Snapshot, error)

GetSnapshot gets a snapshot. To distinguish between an API error reading the snapshot and a non-existent snapshot, this method may return (nil, nil).

func (*StorageDriver) GetSnapshots

func (d *StorageDriver) GetSnapshots(volConfig *storage.VolumeConfig) ([]*storage.Snapshot, error)

GetSnapshots returns the list of snapshots associated with the specified volume

func (*StorageDriver) GetStorageBackendSpecs

func (d *StorageDriver) GetStorageBackendSpecs(backend *storage.Backend) error

func (*StorageDriver) GetUpdateType

func (d *StorageDriver) GetUpdateType(driverOrig storage.Driver) *roaring.Bitmap

GetUpdateType returns a bitmap populated with updates to the driver

func (*StorageDriver) GetVolumeExternal

func (d *StorageDriver) GetVolumeExternal(name string) (*storage.VolumeExternal, error)

func (*StorageDriver) GetVolumeExternalWrappers

func (d *StorageDriver) GetVolumeExternalWrappers(
	channel chan *storage.VolumeExternalWrapper)

func (*StorageDriver) Import

func (d *StorageDriver) Import(volConfig *storage.VolumeConfig, originalName string) error

func (*StorageDriver) Initialize

func (d *StorageDriver) Initialize(
	context tridentconfig.DriverContext, configJSON string, commonConfig *drivers.CommonStorageDriverConfig,
) error

func (*StorageDriver) Initialized

func (d *StorageDriver) Initialized() bool

func (*StorageDriver) Name

func (d *StorageDriver) Name() string

func (*StorageDriver) Publish

func (d *StorageDriver) Publish(name string, publishInfo *utils.VolumePublishInfo) error

func (*StorageDriver) Rename

func (d *StorageDriver) Rename(name string, newName string) error

func (*StorageDriver) Resize

func (d *StorageDriver) Resize(volConfig *storage.VolumeConfig, sizeBytes uint64) error

Resize expands the volume size.

func (*StorageDriver) RestoreSnapshot

func (d *StorageDriver) RestoreSnapshot(snapConfig *storage.SnapshotConfig) error

RestoreSnapshot restores a volume (in place) from a snapshot.

func (*StorageDriver) StoreConfig

func (*StorageDriver) Terminate

func (d *StorageDriver) Terminate()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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