Documentation
¶
Index ¶
- Constants
- type Driver
- func (m *Driver) CreateCluster(numNodes int, nodes *v1.NodeList) error
- func (m *Driver) GetClusterID() (string, error)
- func (m Driver) GetNodes() ([]*storkvolume.NodeInfo, error)
- func (m Driver) GetPodVolumes(podSpec *v1.PodSpec, namespace string) ([]*storkvolume.Info, error)
- func (m *Driver) GetSnapshotPlugin() snapshotVolume.Plugin
- func (m *Driver) GetSnapshotType(snap *snapv1.VolumeSnapshot) (string, error)
- func (m *Driver) GetStorageClassName() string
- func (m *Driver) GetVolumeClaimTemplates([]v1.PersistentVolumeClaim) ([]v1.PersistentVolumeClaim, error)
- func (m Driver) Init(_ interface{}) error
- func (m Driver) InspectNode(id string) (*storkvolume.NodeInfo, error)
- func (m Driver) InspectVolume(volumeID string) (*storkvolume.Info, error)
- func (m *Driver) NewPVC(volumeName string) *v1.PersistentVolumeClaim
- func (m *Driver) OwnsPV(pv *v1.PersistentVolume) bool
- func (m *Driver) OwnsPVC(coreOps core.Ops, pvc *v1.PersistentVolumeClaim) bool
- func (m *Driver) ProvisionVolume(volumeName string, replicaIndexes []int, size uint64, labels map[string]string) error
- func (m *Driver) SetInterfaceError(err error)
- func (m Driver) Stop() error
- func (m Driver) String() string
- func (m *Driver) UpdateNodeIP(nodeIndex int, ip string) error
- func (m *Driver) UpdateNodeStatus(nodeIndex int, nodeStatus storkvolume.NodeStatus) error
Constants ¶
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 { storkvolume.ClusterPairNotSupported storkvolume.MigrationNotSupported storkvolume.GroupSnapshotNotSupported storkvolume.ClusterDomainsNotSupported storkvolume.BackupRestoreNotSupported storkvolume.CloneNotSupported storkvolume.SnapshotRestoreNotSupported // contains filtered or unexported fields }
Driver Mock driver for tests
func (*Driver) CreateCluster ¶
CreateCluster Creates a cluster with specified number of nodes
func (*Driver) GetClusterID ¶ added in v1.4.0
GetClusterID returns the clusterID for the driver
func (Driver) GetNodes ¶
func (m Driver) GetNodes() ([]*storkvolume.NodeInfo, error)
GetNodes Get info about the nodes where the driver is running
func (Driver) GetPodVolumes ¶
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) GetSnapshotType ¶ added in v1.4.0
func (m *Driver) GetSnapshotType(snap *snapv1.VolumeSnapshot) (string, error)
GetSnapshotType Not implemented for mock driver
func (*Driver) GetStorageClassName ¶
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) InspectNode ¶ added in v1.4.0
func (m Driver) InspectNode(id string) (*storkvolume.NodeInfo, error)
InspectNode using ID
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) OwnsPV ¶ added in v1.4.0
func (m *Driver) OwnsPV(pv *v1.PersistentVolume) bool
OwnsPV returns true because it owns all PVC created by tests
func (*Driver) OwnsPVC ¶ added in v1.4.0
OwnsPVC returns true because it owns all PVCs created by tests
func (*Driver) ProvisionVolume ¶
func (m *Driver) ProvisionVolume( volumeName string, replicaIndexes []int, size uint64, labels map[string]string, ) error
ProvisionVolume Provision a volume in the mock driver
func (*Driver) SetInterfaceError ¶
SetInterfaceError to the specified error. Used for negative testing
func (*Driver) UpdateNodeIP ¶ added in v1.4.0
UpdateNodeIP Update IP for a node
func (*Driver) UpdateNodeStatus ¶
func (m *Driver) UpdateNodeStatus( nodeIndex int, nodeStatus storkvolume.NodeStatus, ) error
UpdateNodeStatus Update status for a node