Documentation ¶
Index ¶
- Constants
- func Clone(a, b interface{})
- func NewFakeStorageBackend(ctx context.Context, configJSON, backendUUID string) (sb *storage.StorageBackend, err error)
- func NewFakeStorageDriverConfigJSON(name string, protocol tridentconfig.Protocol, ...) (string, error)
- func NewFakeStorageDriverConfigJSONWithDebugTraceFlags(name string, protocol tridentconfig.Protocol, debugTraceFlags map[string]bool, ...) (string, error)
- func NewFakeStorageDriverConfigJSONWithVirtualPools(name string, protocol tridentconfig.Protocol, ...) (string, error)
- type StorageDriver
- func NewFakeStorageDriver(ctx context.Context, config drivers.FakeStorageDriverConfig) *StorageDriver
- func NewFakeStorageDriverWithDebugTraceFlags(debugTraceFlags map[string]bool) *StorageDriver
- func NewFakeStorageDriverWithPools(_ context.Context, pools map[string]*fake.StoragePool, ...) (*StorageDriver, error)
- func (d *StorageDriver) BackendName() string
- func (d *StorageDriver) BootstrapSnapshot(ctx context.Context, snapshot *storage.Snapshot, ...)
- func (d *StorageDriver) BootstrapVolume(ctx context.Context, volume *storage.Volume)
- func (d *StorageDriver) CanSnapshot(_ context.Context, _ *storage.SnapshotConfig, _ *storage.VolumeConfig) error
- func (d StorageDriver) CopyVolumes(volumes map[string]fake.Volume)
- func (d *StorageDriver) Create(ctx context.Context, volConfig *storage.VolumeConfig, storagePool storage.Pool, ...) error
- func (d *StorageDriver) CreateClone(ctx context.Context, _, cloneVolConfig *storage.VolumeConfig, _ storage.Pool) error
- func (d *StorageDriver) CreateFollowup(_ context.Context, volConfig *storage.VolumeConfig) error
- func (d *StorageDriver) CreatePrepare(ctx context.Context, volConfig *storage.VolumeConfig)
- func (d *StorageDriver) CreateSnapshot(ctx context.Context, snapConfig *storage.SnapshotConfig, ...) (*storage.Snapshot, error)
- func (d *StorageDriver) DeleteSnapshot(_ context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig) error
- func (d *StorageDriver) Destroy(ctx context.Context, volConfig *storage.VolumeConfig) error
- func (d StorageDriver) EnablePublishEnforcement(ctx context.Context, volume *storage.Volume) error
- func (d *StorageDriver) Get(_ context.Context, name string) error
- func (d StorageDriver) GetCommonConfig(context.Context) *drivers.CommonStorageDriverConfig
- func (d *StorageDriver) GetExternalConfig(context.Context) interface{}
- func (d *StorageDriver) GetInternalVolumeName(_ context.Context, name string) string
- func (d *StorageDriver) GetProtocol(context.Context) tridentconfig.Protocol
- func (d *StorageDriver) GetSnapshot(_ context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig) (*storage.Snapshot, error)
- func (d *StorageDriver) GetSnapshots(_ context.Context, volConfig *storage.VolumeConfig) ([]*storage.Snapshot, error)
- func (d *StorageDriver) GetStorageBackendPhysicalPoolNames(context.Context) []string
- func (d *StorageDriver) GetStorageBackendSpecs(_ context.Context, backend storage.Backend) error
- func (d *StorageDriver) GetUpdateType(_ context.Context, driverOrig storage.Driver) *roaring.Bitmap
- func (d *StorageDriver) GetVolumeExternal(_ context.Context, name string) (*storage.VolumeExternal, error)
- func (d *StorageDriver) GetVolumeExternalWrappers(_ context.Context, channel chan *storage.VolumeExternalWrapper)
- func (d StorageDriver) GoString() string
- func (d *StorageDriver) Import(ctx context.Context, volConfig *storage.VolumeConfig, originalName string) error
- func (d *StorageDriver) Initialize(ctx context.Context, _ tridentconfig.DriverContext, configJSON string, ...) error
- func (d *StorageDriver) Initialized() bool
- func (d *StorageDriver) Name() string
- func (d *StorageDriver) Publish(context.Context, *storage.VolumeConfig, *utils.VolumePublishInfo) error
- func (d *StorageDriver) ReconcileNodeAccess(ctx context.Context, nodes []*utils.Node, _ string) error
- func (d *StorageDriver) Rename(ctx context.Context, name, newName string) error
- func (d *StorageDriver) Resize(_ context.Context, volConfig *storage.VolumeConfig, sizeBytes uint64) error
- func (d *StorageDriver) RestoreSnapshot(_ context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig) error
- func (d *StorageDriver) StoreConfig(_ context.Context, b *storage.PersistentStorageBackendConfig)
- func (d StorageDriver) String() string
- func (d *StorageDriver) Terminate(context.Context, string)
Constants ¶
const ( MinimumVolumeSizeBytes = 1048576 // 1 MiB // Constants for internal pool attributes Size = "size" Region = "region" Zone = "zone" // Constants for special use cases PVC_creating_01 = "creating-c44b-40f9-a0a2-a09172f1a1f6" PVC_creating_02 = "creating-686e-4960-9135-b040c2d54332" PVC_creating_clone_03 = "creating-382g-4ccj-k0k4-z88la30d9k22" )
Variables ¶
This section is empty.
Functions ¶
func NewFakeStorageBackend ¶
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 // CreatingVolumes is used to test VolumeCreatingTransactions CreatingVolumes map[string]fake.CreatingVolume // 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 Secret string // contains filtered or unexported fields }
func NewFakeStorageDriver ¶
func NewFakeStorageDriver(ctx context.Context, config drivers.FakeStorageDriverConfig) *StorageDriver
func NewFakeStorageDriverWithDebugTraceFlags ¶
func NewFakeStorageDriverWithDebugTraceFlags(debugTraceFlags map[string]bool) *StorageDriver
func NewFakeStorageDriverWithPools ¶
func NewFakeStorageDriverWithPools( _ context.Context, pools map[string]*fake.StoragePool, vpool drivers.FakeStorageDriverPool, vpools []drivers.FakeStorageDriverPool, ) (*StorageDriver, error)
func (*StorageDriver) BackendName ¶
func (d *StorageDriver) BackendName() string
BackendName returns the name of the backend managed by this driver instance
func (*StorageDriver) BootstrapSnapshot ¶
func (d *StorageDriver) BootstrapSnapshot( ctx context.Context, snapshot *storage.Snapshot, volConfig *storage.VolumeConfig, )
func (*StorageDriver) BootstrapVolume ¶
func (d *StorageDriver) BootstrapVolume(ctx context.Context, volume *storage.Volume)
func (*StorageDriver) CanSnapshot ¶
func (d *StorageDriver) CanSnapshot(_ context.Context, _ *storage.SnapshotConfig, _ *storage.VolumeConfig) error
CanSnapshot determines whether a snapshot as specified in the provided snapshot config may be taken.
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) CreateClone ¶
func (d *StorageDriver) CreateClone( ctx context.Context, _, cloneVolConfig *storage.VolumeConfig, _ storage.Pool, ) error
func (*StorageDriver) CreateFollowup ¶
func (d *StorageDriver) CreateFollowup(_ context.Context, volConfig *storage.VolumeConfig) error
func (*StorageDriver) CreatePrepare ¶
func (d *StorageDriver) CreatePrepare(ctx context.Context, volConfig *storage.VolumeConfig)
func (*StorageDriver) CreateSnapshot ¶
func (d *StorageDriver) CreateSnapshot( ctx context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig, ) (*storage.Snapshot, error)
CreateSnapshot creates a snapshot for the given volume
func (*StorageDriver) DeleteSnapshot ¶
func (d *StorageDriver) DeleteSnapshot( _ context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig, ) error
DeleteSnapshot creates a snapshot of a volume.
func (*StorageDriver) Destroy ¶
func (d *StorageDriver) Destroy(ctx context.Context, volConfig *storage.VolumeConfig) error
func (StorageDriver) EnablePublishEnforcement ¶
func (StorageDriver) GetCommonConfig ¶
func (d StorageDriver) GetCommonConfig(context.Context) *drivers.CommonStorageDriverConfig
GetCommonConfig returns driver's CommonConfig
func (*StorageDriver) GetExternalConfig ¶
func (d *StorageDriver) GetExternalConfig(context.Context) interface{}
func (*StorageDriver) GetInternalVolumeName ¶
func (d *StorageDriver) GetInternalVolumeName(_ context.Context, name string) string
func (*StorageDriver) GetProtocol ¶
func (d *StorageDriver) GetProtocol(context.Context) tridentconfig.Protocol
func (*StorageDriver) GetSnapshot ¶
func (d *StorageDriver) GetSnapshot( _ context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig, ) (*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(_ context.Context, volConfig *storage.VolumeConfig) ( []*storage.Snapshot, error, )
GetSnapshots returns the list of snapshots associated with the specified volume
func (*StorageDriver) GetStorageBackendPhysicalPoolNames ¶
func (d *StorageDriver) GetStorageBackendPhysicalPoolNames(context.Context) []string
GetStorageBackendPhysicalPoolNames retrieves storage backend physical pools
func (*StorageDriver) GetStorageBackendSpecs ¶
func (*StorageDriver) GetUpdateType ¶
GetUpdateType returns a bitmap populated with updates to the driver
func (*StorageDriver) GetVolumeExternal ¶
func (d *StorageDriver) GetVolumeExternal(_ context.Context, name string) (*storage.VolumeExternal, error)
func (*StorageDriver) GetVolumeExternalWrappers ¶
func (d *StorageDriver) GetVolumeExternalWrappers(_ context.Context, channel chan *storage.VolumeExternalWrapper)
func (StorageDriver) GoString ¶
func (d StorageDriver) GoString() string
GoString implements GoStringer interface for the FakeStorageDriver driver
func (*StorageDriver) Import ¶
func (d *StorageDriver) Import(ctx context.Context, volConfig *storage.VolumeConfig, originalName string) error
func (*StorageDriver) Initialize ¶
func (d *StorageDriver) Initialize( ctx context.Context, _ tridentconfig.DriverContext, configJSON string, commonConfig *drivers.CommonStorageDriverConfig, backendSecret map[string]string, _ string, ) error
func (*StorageDriver) Initialized ¶
func (d *StorageDriver) Initialized() bool
func (*StorageDriver) Name ¶
func (d *StorageDriver) Name() string
func (*StorageDriver) Publish ¶
func (d *StorageDriver) Publish(context.Context, *storage.VolumeConfig, *utils.VolumePublishInfo) error
func (*StorageDriver) ReconcileNodeAccess ¶
func (*StorageDriver) Rename ¶
func (d *StorageDriver) Rename(ctx context.Context, name, newName string) error
func (*StorageDriver) Resize ¶
func (d *StorageDriver) Resize(_ context.Context, volConfig *storage.VolumeConfig, sizeBytes uint64) error
Resize expands the volume size.
func (*StorageDriver) RestoreSnapshot ¶
func (d *StorageDriver) RestoreSnapshot( _ context.Context, snapConfig *storage.SnapshotConfig, _ *storage.VolumeConfig, ) error
RestoreSnapshot restores a volume (in place) from a snapshot.
func (*StorageDriver) StoreConfig ¶
func (d *StorageDriver) StoreConfig(_ context.Context, b *storage.PersistentStorageBackendConfig)
func (StorageDriver) String ¶
func (d StorageDriver) String() string
String implements Stringer interface for the FakeStorageDriver driver