mock

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// RackLabel Label used for the mock driver to set rack information
	RackLabel = "mock/rack"
	// ZoneLabel Label used for the mock driver to set zone information
	ZoneLabel = "mock/zone"
	// RegionLabel Label used for the mock driver to set region information
	RegionLabel = "mock/region"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver Mock driver for tests

func (*Driver) CreateCluster

func (m *Driver) CreateCluster(numNodes int, nodes *v1.NodeList) error

CreateCluster Creates a cluster with specified number of nodes

func (Driver) GetNodes

func (m Driver) GetNodes() ([]*storkvolume.NodeInfo, error)

GetNodes Get info about the nodes where the driver is running

func (Driver) GetPodVolumes

func (m Driver) GetPodVolumes(podSpec *v1.PodSpec, namespace string) ([]*storkvolume.Info, error)

GetPodVolumes Get the Volumes in the Pod that use the mock driver

func (*Driver) GetSnapshotPlugin

func (m *Driver) GetSnapshotPlugin() snapshotVolume.Plugin

GetSnapshotPlugin Returns nil since snapshot is not supported in the mock driver

func (*Driver) GetStorageClassName

func (m *Driver) GetStorageClassName() string

GetStorageClassName Returns the storageclass name to be used by tests

func (*Driver) GetVolumeClaimTemplates added in v1.1.1

func (m *Driver) GetVolumeClaimTemplates([]v1.PersistentVolumeClaim) (
	[]v1.PersistentVolumeClaim, error)

GetVolumeClaimTemplates Not implemented for mock driver

func (Driver) Init

func (m Driver) Init(_ interface{}) error

Init Initialize the mock driver

func (Driver) InspectVolume

func (m Driver) InspectVolume(volumeID string) (*storkvolume.Info, error)

InspectVolume Return information for a given volume

func (*Driver) NewPVC

func (m *Driver) NewPVC(volumeName string) *v1.PersistentVolumeClaim

NewPVC Create a new PVC reference

func (*Driver) ProvisionVolume

func (m *Driver) ProvisionVolume(
	volumeName string,
	replicaIndexes []int,
	size uint64,
) error

ProvisionVolume Provision a volume in the mock driver

func (*Driver) SetInterfaceError

func (m *Driver) SetInterfaceError(err error)

SetInterfaceError to the specified error. Used for negative testing

func (Driver) Stop added in v1.1.1

func (m Driver) Stop() error

Stop Stops the mock driver

func (Driver) String

func (m Driver) String() string

String Returns the name for the driver

func (*Driver) UpdateNodeStatus

func (m *Driver) UpdateNodeStatus(
	nodeIndex int,
	nodeStatus storkvolume.NodeStatus,
) error

UpdateNodeStatus Update status for a node

Jump to

Keyboard shortcuts

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