Documentation ¶
Index ¶
- func ContainsAccessMode(modes []v1.PersistentVolumeAccessMode, mode v1.PersistentVolumeAccessMode) bool
- func CreateTestPVC(capacity string, accessModes []v1.PersistentVolumeAccessMode) *v1.PersistentVolumeClaim
- func FindEmptyDirectoryUsageOnTmpfs() (*resource.Quantity, error)
- func GetTestVolumePluginMgr(t *testing.T) (*VolumePluginMgr, *FakeVolumePlugin)
- func MetricsEqualIgnoreTimestamp(a *Metrics, b *Metrics) bool
- func NewBlockVolumePathHandler() volumepathhandler.BlockVolumePathHandler
- func NewFakeFileVolumePlugin() []VolumePlugin
- func NewFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin) *fakeVolumeHost
- func NewFakeVolumeHostWithCloudProvider(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, ...) *fakeVolumeHost
- func NewFakeVolumeHostWithNodeLabels(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, ...) *fakeVolumeHost
- func NewFakeVolumeHostWithNodeName(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, ...) *fakeVolumeHost
- func ProbeVolumePlugins(config VolumeConfig) []VolumePlugin
- func VerifyAttachCallCount(expectedAttachCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyDetachCallCount(expectedDetachCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyGetGlobalMapPathCallCount(expectedGlobalMapPathCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyGetMapDeviceCallCount(expectedMapDeviceCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyGetPodDeviceMapPathCallCount(expectedPodDeviceMapPathCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyMountDeviceCallCount(expectedMountDeviceCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifySetUpCallCount(expectedSetUpCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifySetUpDeviceCallCount(expectedSetUpDeviceCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyTearDownCallCount(expectedTearDownCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyTearDownDeviceCallCount(expectedTearDownDeviceCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyWaitForAttachCallCount(expectedWaitForAttachCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyZeroAttachCalls(fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyZeroDetachCallCount(fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyZeroMountDeviceCallCount(fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyZeroSetUpCallCount(fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyZeroTearDownCallCount(fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyZeroTearDownDeviceCallCount(fakeVolumePlugin *FakeVolumePlugin) error
- func VerifyZeroWaitForAttachCallCount(fakeVolumePlugin *FakeVolumePlugin) error
- type FakeDeleter
- type FakeFileVolumePlugin
- func (plugin *FakeFileVolumePlugin) CanSupport(spec *Spec) bool
- func (plugin *FakeFileVolumePlugin) ConstructVolumeSpec(volumeName, mountPath string) (*Spec, error)
- func (plugin *FakeFileVolumePlugin) GetPluginName() string
- func (plugin *FakeFileVolumePlugin) GetVolumeName(spec *Spec) (string, error)
- func (plugin *FakeFileVolumePlugin) Init(host VolumeHost) error
- func (plugin *FakeFileVolumePlugin) NewMounter(spec *Spec, podRef *v1.Pod, opts VolumeOptions) (Mounter, error)
- func (plugin *FakeFileVolumePlugin) NewUnmounter(name string, podUID types.UID) (Unmounter, error)
- func (plugin *FakeFileVolumePlugin) RequiresRemount() bool
- func (plugin *FakeFileVolumePlugin) SupportsBulkVolumeVerification() bool
- func (plugin *FakeFileVolumePlugin) SupportsMountOption() bool
- type FakeProvisioner
- type FakeVolume
- func (fv *FakeVolume) Attach(spec *Spec, nodeName types.NodeName) (string, error)
- func (fv *FakeVolume) CanMount() error
- func (fv *FakeVolume) Detach(volumeName string, nodeName types.NodeName) error
- func (fv *FakeVolume) GetAttachCallCount() int
- func (_ *FakeVolume) GetAttributes() Attributes
- func (fv *FakeVolume) GetDetachCallCount() int
- func (fv *FakeVolume) GetDeviceMountPath(spec *Spec) (string, error)
- func (fv *FakeVolume) GetGlobalMapPath(spec *Spec) (string, error)
- func (fv *FakeVolume) GetGlobalMapPathCallCount() int
- func (fv *FakeVolume) GetMapDeviceCallCount() int
- func (fv *FakeVolume) GetMountDeviceCallCount() int
- func (fv *FakeVolume) GetPath() string
- func (fv *FakeVolume) GetPodDeviceMapPath() (string, string)
- func (fv *FakeVolume) GetPodDeviceMapPathCallCount() int
- func (fv *FakeVolume) GetSetUpCallCount() int
- func (fv *FakeVolume) GetSetUpDeviceCallCount() int
- func (fv *FakeVolume) GetTearDownCallCount() int
- func (fv *FakeVolume) GetTearDownDeviceCallCount() int
- func (fv *FakeVolume) GetWaitForAttachCallCount() int
- func (fv *FakeVolume) MapDevice(devicePath, globalMapPath, volumeMapPath, volumeMapName string, pod types.UID) error
- func (fv *FakeVolume) MountDevice(spec *Spec, devicePath string, deviceMountPath string) error
- func (fv *FakeVolume) SetUp(fsGroup *int64) error
- func (fv *FakeVolume) SetUpAt(dir string, fsGroup *int64) error
- func (fv *FakeVolume) SetUpDevice() (string, error)
- func (fv *FakeVolume) TearDown() error
- func (fv *FakeVolume) TearDownAt(dir string) error
- func (fv *FakeVolume) TearDownDevice(mapPath string, devicePath string) error
- func (fv *FakeVolume) UnmountDevice(globalMountPath string) error
- func (fv *FakeVolume) VolumesAreAttached(spec []*Spec, nodeName types.NodeName) (map[*Spec]bool, error)
- func (fv *FakeVolume) WaitForAttach(spec *Spec, devicePath string, pod *v1.Pod, spectimeout time.Duration) (string, error)
- type FakeVolumePathHandler
- func (fv *FakeVolumePathHandler) AttachFileDevice(path string) (string, error)
- func (fv *FakeVolumePathHandler) FindGlobalMapPathUUIDFromPod(pluginDir, mapPath string, podUID types.UID) (string, error)
- func (fv *FakeVolumePathHandler) GetDeviceSymlinkRefs(devPath string, mapPath string) ([]string, error)
- func (fv *FakeVolumePathHandler) GetLoopDevice(path string) (string, error)
- func (fv *FakeVolumePathHandler) IsSymlinkExist(mapPath string) (bool, error)
- func (fv *FakeVolumePathHandler) MapDevice(devicePath string, mapDir string, linkName string) error
- func (fv *FakeVolumePathHandler) RemoveLoopDevice(device string) error
- func (fv *FakeVolumePathHandler) RemoveMapPath(mapPath string) error
- func (fv *FakeVolumePathHandler) UnmapDevice(mapDir string, linkName string) error
- type FakeVolumePlugin
- func (plugin *FakeVolumePlugin) CanSupport(spec *Spec) bool
- func (plugin *FakeVolumePlugin) ConstructBlockVolumeSpec(podUID types.UID, volumeName, mountPath string) (*Spec, error)
- func (plugin *FakeVolumePlugin) ConstructVolumeSpec(volumeName, mountPath string) (*Spec, error)
- func (plugin *FakeVolumePlugin) ExpandVolumeDevice(spec *Spec, newSize resource.Quantity, oldSize resource.Quantity) (resource.Quantity, error)
- func (plugin *FakeVolumePlugin) GetAccessModes() []v1.PersistentVolumeAccessMode
- func (plugin *FakeVolumePlugin) GetAttachers() (Attachers []*FakeVolume)
- func (plugin *FakeVolumePlugin) GetBlockVolumeMapper() (BlockVolumeMappers []*FakeVolume)
- func (plugin *FakeVolumePlugin) GetBlockVolumeUnmapper() (BlockVolumeUnmappers []*FakeVolume)
- func (plugin *FakeVolumePlugin) GetDetachers() (Detachers []*FakeVolume)
- func (plugin *FakeVolumePlugin) GetDeviceMountRefs(deviceMountPath string) ([]string, error)
- func (plugin *FakeVolumePlugin) GetMounters() (Mounters []*FakeVolume)
- func (plugin *FakeVolumePlugin) GetNewAttacherCallCount() int
- func (plugin *FakeVolumePlugin) GetNewDetacherCallCount() int
- func (plugin *FakeVolumePlugin) GetPluginName() string
- func (plugin *FakeVolumePlugin) GetUnmounters() (Unmounters []*FakeVolume)
- func (plugin *FakeVolumePlugin) GetVolumeName(spec *Spec) (string, error)
- func (plugin *FakeVolumePlugin) Init(host VolumeHost) error
- func (plugin *FakeVolumePlugin) NewAttacher() (Attacher, error)
- func (plugin *FakeVolumePlugin) NewBlockVolumeMapper(spec *Spec, pod *v1.Pod, opts VolumeOptions) (BlockVolumeMapper, error)
- func (plugin *FakeVolumePlugin) NewBlockVolumeUnmapper(volName string, podUID types.UID) (BlockVolumeUnmapper, error)
- func (plugin *FakeVolumePlugin) NewDeleter(spec *Spec) (Deleter, error)
- func (plugin *FakeVolumePlugin) NewDetacher() (Detacher, error)
- func (plugin *FakeVolumePlugin) NewMounter(spec *Spec, pod *v1.Pod, opts VolumeOptions) (Mounter, error)
- func (plugin *FakeVolumePlugin) NewProvisioner(options VolumeOptions) (Provisioner, error)
- func (plugin *FakeVolumePlugin) NewUnmounter(volName string, podUID types.UID) (Unmounter, error)
- func (plugin *FakeVolumePlugin) Recycle(pvName string, spec *Spec, eventRecorder recyclerclient.RecycleEventRecorder) error
- func (plugin *FakeVolumePlugin) RequiresFSResize() bool
- func (plugin *FakeVolumePlugin) RequiresRemount() bool
- func (plugin *FakeVolumePlugin) SupportsBulkVolumeVerification() bool
- func (plugin *FakeVolumePlugin) SupportsMountOption() bool
- type MockVolume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsAccessMode ¶ added in v1.9.0
func ContainsAccessMode(modes []v1.PersistentVolumeAccessMode, mode v1.PersistentVolumeAccessMode) bool
func CreateTestPVC ¶ added in v1.5.0
func CreateTestPVC(capacity string, accessModes []v1.PersistentVolumeAccessMode) *v1.PersistentVolumeClaim
CreateTestPVC returns a provisionable PVC for tests
func FindEmptyDirectoryUsageOnTmpfs ¶
FindEmptyDirectoryUsageOnTmpfs finds the expected usage of an empty directory existing on a tmpfs filesystem on this system.
func GetTestVolumePluginMgr ¶ added in v1.3.0
func GetTestVolumePluginMgr( t *testing.T) (*VolumePluginMgr, *FakeVolumePlugin)
GetTestVolumePluginMgr creates, initializes, and returns a test volume plugin manager and fake volume plugin using a fake volume host.
func MetricsEqualIgnoreTimestamp ¶ added in v1.6.0
func MetricsEqualIgnoreTimestamp(a *Metrics, b *Metrics) bool
func NewBlockVolumePathHandler ¶ added in v1.9.0
func NewBlockVolumePathHandler() volumepathhandler.BlockVolumePathHandler
NewDeviceHandler Create a new IoHandler implementation
func NewFakeFileVolumePlugin ¶ added in v1.9.0
func NewFakeFileVolumePlugin() []VolumePlugin
func NewFakeVolumeHost ¶
func NewFakeVolumeHostWithCloudProvider ¶ added in v1.8.0
func NewFakeVolumeHostWithCloudProvider(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, cloud cloudprovider.Interface) *fakeVolumeHost
func NewFakeVolumeHostWithNodeLabels ¶ added in v1.8.0
func NewFakeVolumeHostWithNodeName ¶ added in v1.9.0
func ProbeVolumePlugins ¶
func ProbeVolumePlugins(config VolumeConfig) []VolumePlugin
func VerifyAttachCallCount ¶ added in v1.3.0
func VerifyAttachCallCount( expectedAttachCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifyAttachCallCount ensures that at least one of the Attachers for this plugin has the expectedAttachCallCount number of calls. Otherwise it returns an error.
func VerifyDetachCallCount ¶ added in v1.3.0
func VerifyDetachCallCount( expectedDetachCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifyDetachCallCount ensures that at least one of the Attachers for this plugin has the expectedDetachCallCount number of calls. Otherwise it returns an error.
func VerifyGetGlobalMapPathCallCount ¶ added in v1.9.0
func VerifyGetGlobalMapPathCallCount( expectedGlobalMapPathCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifyGetGlobalMapPathCallCount ensures that at least one of the Mappers for this plugin has the expectedGlobalMapPathCallCount number of calls. Otherwise it returns an error.
func VerifyGetMapDeviceCallCount ¶ added in v1.11.0
func VerifyGetMapDeviceCallCount( expectedMapDeviceCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifyGetMapDeviceCallCount ensures that at least one of the Mappers for this plugin has the expectedMapDeviceCallCount number of calls. Otherwise it returns an error.
func VerifyGetPodDeviceMapPathCallCount ¶ added in v1.9.0
func VerifyGetPodDeviceMapPathCallCount( expectedPodDeviceMapPathCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifyGetPodDeviceMapPathCallCount ensures that at least one of the Mappers for this plugin has the expectedPodDeviceMapPathCallCount number of calls. Otherwise it returns an error.
func VerifyMountDeviceCallCount ¶ added in v1.3.0
func VerifyMountDeviceCallCount( expectedMountDeviceCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifyMountDeviceCallCount ensures that at least one of the Mounters for this plugin has the expectedMountDeviceCallCount number of calls. Otherwise it returns an error.
func VerifySetUpCallCount ¶ added in v1.3.0
func VerifySetUpCallCount( expectedSetUpCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifySetUpCallCount ensures that at least one of the Mounters for this plugin has the expectedSetUpCallCount number of calls. Otherwise it returns an error.
func VerifySetUpDeviceCallCount ¶ added in v1.9.0
func VerifySetUpDeviceCallCount( expectedSetUpDeviceCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifySetUpDeviceCallCount ensures that at least one of the Mappers for this plugin has the expectedSetUpDeviceCallCount number of calls. Otherwise it returns an error.
func VerifyTearDownCallCount ¶ added in v1.3.0
func VerifyTearDownCallCount( expectedTearDownCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifyTearDownCallCount ensures that at least one of the Unounters for this plugin has the expectedTearDownCallCount number of calls. Otherwise it returns an error.
func VerifyTearDownDeviceCallCount ¶ added in v1.9.0
func VerifyTearDownDeviceCallCount( expectedTearDownDeviceCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifyTearDownDeviceCallCount ensures that at least one of the Unmappers for this plugin has the expectedTearDownDeviceCallCount number of calls. Otherwise it returns an error.
func VerifyWaitForAttachCallCount ¶ added in v1.3.0
func VerifyWaitForAttachCallCount( expectedWaitForAttachCallCount int, fakeVolumePlugin *FakeVolumePlugin) error
VerifyWaitForAttachCallCount ensures that at least one of the Mounters for this plugin has the expectedWaitForAttachCallCount number of calls. Otherwise it returns an error.
func VerifyZeroAttachCalls ¶ added in v1.3.0
func VerifyZeroAttachCalls(fakeVolumePlugin *FakeVolumePlugin) error
VerifyZeroAttachCalls ensures that all of the Attachers for this plugin have a zero AttachCallCount. Otherwise it returns an error.
func VerifyZeroDetachCallCount ¶ added in v1.3.0
func VerifyZeroDetachCallCount(fakeVolumePlugin *FakeVolumePlugin) error
VerifyZeroDetachCallCount ensures that all Detachers for this plugin have a zero DetachCallCount. Otherwise it returns an error.
func VerifyZeroMountDeviceCallCount ¶ added in v1.3.0
func VerifyZeroMountDeviceCallCount(fakeVolumePlugin *FakeVolumePlugin) error
VerifyZeroMountDeviceCallCount ensures that all Attachers for this plugin have a zero MountDeviceCallCount. Otherwise it returns an error.
func VerifyZeroSetUpCallCount ¶ added in v1.3.0
func VerifyZeroSetUpCallCount(fakeVolumePlugin *FakeVolumePlugin) error
VerifyZeroSetUpCallCount ensures that all Mounters for this plugin have a zero SetUpCallCount. Otherwise it returns an error.
func VerifyZeroTearDownCallCount ¶ added in v1.3.0
func VerifyZeroTearDownCallCount(fakeVolumePlugin *FakeVolumePlugin) error
VerifyZeroTearDownCallCount ensures that all Mounters for this plugin have a zero TearDownCallCount. Otherwise it returns an error.
func VerifyZeroTearDownDeviceCallCount ¶ added in v1.9.0
func VerifyZeroTearDownDeviceCallCount(fakeVolumePlugin *FakeVolumePlugin) error
VerifyZeroTearDownDeviceCallCount ensures that all Mappers for this plugin have a zero TearDownDeviceCallCount. Otherwise it returns an error.
func VerifyZeroWaitForAttachCallCount ¶ added in v1.3.0
func VerifyZeroWaitForAttachCallCount(fakeVolumePlugin *FakeVolumePlugin) error
VerifyZeroWaitForAttachCallCount ensures that all Attachers for this plugin have a zero WaitForAttachCallCount. Otherwise it returns an error.
Types ¶
type FakeDeleter ¶
type FakeDeleter struct { MetricsNil // contains filtered or unexported fields }
func (*FakeDeleter) Delete ¶
func (fd *FakeDeleter) Delete() error
func (*FakeDeleter) GetPath ¶
func (fd *FakeDeleter) GetPath() string
type FakeFileVolumePlugin ¶ added in v1.9.0
type FakeFileVolumePlugin struct { }
func (*FakeFileVolumePlugin) CanSupport ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) CanSupport(spec *Spec) bool
func (*FakeFileVolumePlugin) ConstructVolumeSpec ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) ConstructVolumeSpec(volumeName, mountPath string) (*Spec, error)
func (*FakeFileVolumePlugin) GetPluginName ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) GetPluginName() string
func (*FakeFileVolumePlugin) GetVolumeName ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) GetVolumeName(spec *Spec) (string, error)
func (*FakeFileVolumePlugin) Init ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) Init(host VolumeHost) error
func (*FakeFileVolumePlugin) NewMounter ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) NewMounter(spec *Spec, podRef *v1.Pod, opts VolumeOptions) (Mounter, error)
func (*FakeFileVolumePlugin) NewUnmounter ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) NewUnmounter(name string, podUID types.UID) (Unmounter, error)
func (*FakeFileVolumePlugin) RequiresRemount ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) RequiresRemount() bool
func (*FakeFileVolumePlugin) SupportsBulkVolumeVerification ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) SupportsBulkVolumeVerification() bool
func (*FakeFileVolumePlugin) SupportsMountOption ¶ added in v1.9.0
func (plugin *FakeFileVolumePlugin) SupportsMountOption() bool
type FakeProvisioner ¶
type FakeProvisioner struct { Options VolumeOptions Host VolumeHost }
func (*FakeProvisioner) Provision ¶
func (fc *FakeProvisioner) Provision(selectedNode *v1.Node, allowedTopologies []v1.TopologySelectorTerm) (*v1.PersistentVolume, error)
type FakeVolume ¶
type FakeVolume struct { sync.RWMutex PodUID types.UID VolName string Plugin *FakeVolumePlugin MetricsNil // Add callbacks as needed WaitForAttachHook func(spec *Spec, devicePath string, pod *v1.Pod, spectimeout time.Duration) (string, error) UnmountDeviceHook func(globalMountPath string) error SetUpCallCount int TearDownCallCount int AttachCallCount int DetachCallCount int WaitForAttachCallCount int MountDeviceCallCount int UnmountDeviceCallCount int GetDeviceMountPathCallCount int SetUpDeviceCallCount int TearDownDeviceCallCount int MapDeviceCallCount int GlobalMapPathCallCount int PodDeviceMapPathCallCount int }
func (*FakeVolume) Attach ¶
func (fv *FakeVolume) Attach(spec *Spec, nodeName types.NodeName) (string, error)
func (*FakeVolume) CanMount ¶ added in v1.5.0
func (fv *FakeVolume) CanMount() error
func (*FakeVolume) Detach ¶
func (fv *FakeVolume) Detach(volumeName string, nodeName types.NodeName) error
func (*FakeVolume) GetAttachCallCount ¶ added in v1.3.0
func (fv *FakeVolume) GetAttachCallCount() int
func (*FakeVolume) GetAttributes ¶
func (_ *FakeVolume) GetAttributes() Attributes
func (*FakeVolume) GetDetachCallCount ¶ added in v1.3.0
func (fv *FakeVolume) GetDetachCallCount() int
func (*FakeVolume) GetDeviceMountPath ¶ added in v1.3.0
func (fv *FakeVolume) GetDeviceMountPath(spec *Spec) (string, error)
func (*FakeVolume) GetGlobalMapPath ¶ added in v1.9.0
func (fv *FakeVolume) GetGlobalMapPath(spec *Spec) (string, error)
Block volume support
func (*FakeVolume) GetGlobalMapPathCallCount ¶ added in v1.9.0
func (fv *FakeVolume) GetGlobalMapPathCallCount() int
Block volume support
func (*FakeVolume) GetMapDeviceCallCount ¶ added in v1.11.0
func (fv *FakeVolume) GetMapDeviceCallCount() int
Block volume support
func (*FakeVolume) GetMountDeviceCallCount ¶ added in v1.3.0
func (fv *FakeVolume) GetMountDeviceCallCount() int
func (*FakeVolume) GetPath ¶
func (fv *FakeVolume) GetPath() string
func (*FakeVolume) GetPodDeviceMapPath ¶ added in v1.9.0
func (fv *FakeVolume) GetPodDeviceMapPath() (string, string)
Block volume support
func (*FakeVolume) GetPodDeviceMapPathCallCount ¶ added in v1.9.0
func (fv *FakeVolume) GetPodDeviceMapPathCallCount() int
Block volume support
func (*FakeVolume) GetSetUpCallCount ¶ added in v1.3.0
func (fv *FakeVolume) GetSetUpCallCount() int
func (*FakeVolume) GetSetUpDeviceCallCount ¶ added in v1.9.0
func (fv *FakeVolume) GetSetUpDeviceCallCount() int
Block volume support
func (*FakeVolume) GetTearDownCallCount ¶ added in v1.3.0
func (fv *FakeVolume) GetTearDownCallCount() int
func (*FakeVolume) GetTearDownDeviceCallCount ¶ added in v1.9.0
func (fv *FakeVolume) GetTearDownDeviceCallCount() int
Block volume support
func (*FakeVolume) GetWaitForAttachCallCount ¶ added in v1.3.0
func (fv *FakeVolume) GetWaitForAttachCallCount() int
func (*FakeVolume) MapDevice ¶ added in v1.11.0
func (fv *FakeVolume) MapDevice(devicePath, globalMapPath, volumeMapPath, volumeMapName string, pod types.UID) error
Block volume support
func (*FakeVolume) MountDevice ¶ added in v1.3.0
func (fv *FakeVolume) MountDevice(spec *Spec, devicePath string, deviceMountPath string) error
func (*FakeVolume) SetUp ¶
func (fv *FakeVolume) SetUp(fsGroup *int64) error
func (*FakeVolume) SetUpDevice ¶ added in v1.9.0
func (fv *FakeVolume) SetUpDevice() (string, error)
Block volume support
func (*FakeVolume) TearDown ¶
func (fv *FakeVolume) TearDown() error
func (*FakeVolume) TearDownAt ¶
func (fv *FakeVolume) TearDownAt(dir string) error
func (*FakeVolume) TearDownDevice ¶ added in v1.9.0
func (fv *FakeVolume) TearDownDevice(mapPath string, devicePath string) error
Block volume support
func (*FakeVolume) UnmountDevice ¶ added in v1.3.0
func (fv *FakeVolume) UnmountDevice(globalMountPath string) error
func (*FakeVolume) VolumesAreAttached ¶ added in v1.4.6
func (fv *FakeVolume) VolumesAreAttached(spec []*Spec, nodeName types.NodeName) (map[*Spec]bool, error)
func (*FakeVolume) WaitForAttach ¶ added in v1.3.0
type FakeVolumePathHandler ¶ added in v1.9.0
func (*FakeVolumePathHandler) AttachFileDevice ¶ added in v1.9.0
func (fv *FakeVolumePathHandler) AttachFileDevice(path string) (string, error)
func (*FakeVolumePathHandler) FindGlobalMapPathUUIDFromPod ¶ added in v1.9.0
func (*FakeVolumePathHandler) GetDeviceSymlinkRefs ¶ added in v1.9.0
func (fv *FakeVolumePathHandler) GetDeviceSymlinkRefs(devPath string, mapPath string) ([]string, error)
func (*FakeVolumePathHandler) GetLoopDevice ¶ added in v1.9.0
func (fv *FakeVolumePathHandler) GetLoopDevice(path string) (string, error)
func (*FakeVolumePathHandler) IsSymlinkExist ¶ added in v1.9.0
func (fv *FakeVolumePathHandler) IsSymlinkExist(mapPath string) (bool, error)
func (*FakeVolumePathHandler) MapDevice ¶ added in v1.9.0
func (fv *FakeVolumePathHandler) MapDevice(devicePath string, mapDir string, linkName string) error
func (*FakeVolumePathHandler) RemoveLoopDevice ¶ added in v1.9.0
func (fv *FakeVolumePathHandler) RemoveLoopDevice(device string) error
func (*FakeVolumePathHandler) RemoveMapPath ¶ added in v1.9.0
func (fv *FakeVolumePathHandler) RemoveMapPath(mapPath string) error
func (*FakeVolumePathHandler) UnmapDevice ¶ added in v1.9.0
func (fv *FakeVolumePathHandler) UnmapDevice(mapDir string, linkName string) error
type FakeVolumePlugin ¶
type FakeVolumePlugin struct { sync.RWMutex PluginName string Host VolumeHost Config VolumeConfig LastProvisionerOptions VolumeOptions NewAttacherCallCount int NewDetacherCallCount int // Add callbacks as needed WaitForAttachHook func(spec *Spec, devicePath string, pod *v1.Pod, spectimeout time.Duration) (string, error) UnmountDeviceHook func(globalMountPath string) error Mounters []*FakeVolume Unmounters []*FakeVolume Attachers []*FakeVolume Detachers []*FakeVolume BlockVolumeMappers []*FakeVolume BlockVolumeUnmappers []*FakeVolume }
FakeVolumePlugin is useful for testing. It tries to be a fully compliant plugin, but all it does is make empty directories. Use as:
volume.RegisterPlugin(&FakePlugin{"fake-name"})
func (*FakeVolumePlugin) CanSupport ¶
func (plugin *FakeVolumePlugin) CanSupport(spec *Spec) bool
func (*FakeVolumePlugin) ConstructBlockVolumeSpec ¶ added in v1.9.0
func (plugin *FakeVolumePlugin) ConstructBlockVolumeSpec(podUID types.UID, volumeName, mountPath string) (*Spec, error)
Block volume support
func (*FakeVolumePlugin) ConstructVolumeSpec ¶ added in v1.4.0
func (plugin *FakeVolumePlugin) ConstructVolumeSpec(volumeName, mountPath string) (*Spec, error)
func (*FakeVolumePlugin) ExpandVolumeDevice ¶ added in v1.11.0
func (plugin *FakeVolumePlugin) ExpandVolumeDevice(spec *Spec, newSize resource.Quantity, oldSize resource.Quantity) (resource.Quantity, error)
Expandable volume support
func (*FakeVolumePlugin) GetAccessModes ¶
func (plugin *FakeVolumePlugin) GetAccessModes() []v1.PersistentVolumeAccessMode
func (*FakeVolumePlugin) GetAttachers ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) GetAttachers() (Attachers []*FakeVolume)
func (*FakeVolumePlugin) GetBlockVolumeMapper ¶ added in v1.9.0
func (plugin *FakeVolumePlugin) GetBlockVolumeMapper() (BlockVolumeMappers []*FakeVolume)
Block volume support
func (*FakeVolumePlugin) GetBlockVolumeUnmapper ¶ added in v1.9.0
func (plugin *FakeVolumePlugin) GetBlockVolumeUnmapper() (BlockVolumeUnmappers []*FakeVolume)
Block volume support
func (*FakeVolumePlugin) GetDetachers ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) GetDetachers() (Detachers []*FakeVolume)
func (*FakeVolumePlugin) GetDeviceMountRefs ¶ added in v1.4.0
func (plugin *FakeVolumePlugin) GetDeviceMountRefs(deviceMountPath string) ([]string, error)
func (*FakeVolumePlugin) GetMounters ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) GetMounters() (Mounters []*FakeVolume)
func (*FakeVolumePlugin) GetNewAttacherCallCount ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) GetNewAttacherCallCount() int
func (*FakeVolumePlugin) GetNewDetacherCallCount ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) GetNewDetacherCallCount() int
func (*FakeVolumePlugin) GetPluginName ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) GetPluginName() string
func (*FakeVolumePlugin) GetUnmounters ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) GetUnmounters() (Unmounters []*FakeVolume)
func (*FakeVolumePlugin) GetVolumeName ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) GetVolumeName(spec *Spec) (string, error)
func (*FakeVolumePlugin) Init ¶
func (plugin *FakeVolumePlugin) Init(host VolumeHost) error
func (*FakeVolumePlugin) NewAttacher ¶
func (plugin *FakeVolumePlugin) NewAttacher() (Attacher, error)
func (*FakeVolumePlugin) NewBlockVolumeMapper ¶ added in v1.9.0
func (plugin *FakeVolumePlugin) NewBlockVolumeMapper(spec *Spec, pod *v1.Pod, opts VolumeOptions) (BlockVolumeMapper, error)
Block volume support
func (*FakeVolumePlugin) NewBlockVolumeUnmapper ¶ added in v1.9.0
func (plugin *FakeVolumePlugin) NewBlockVolumeUnmapper(volName string, podUID types.UID) (BlockVolumeUnmapper, error)
Block volume support
func (*FakeVolumePlugin) NewDeleter ¶
func (plugin *FakeVolumePlugin) NewDeleter(spec *Spec) (Deleter, error)
func (*FakeVolumePlugin) NewDetacher ¶
func (plugin *FakeVolumePlugin) NewDetacher() (Detacher, error)
func (*FakeVolumePlugin) NewMounter ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) NewMounter(spec *Spec, pod *v1.Pod, opts VolumeOptions) (Mounter, error)
func (*FakeVolumePlugin) NewProvisioner ¶
func (plugin *FakeVolumePlugin) NewProvisioner(options VolumeOptions) (Provisioner, error)
func (*FakeVolumePlugin) NewUnmounter ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) NewUnmounter(volName string, podUID types.UID) (Unmounter, error)
func (*FakeVolumePlugin) Recycle ¶ added in v1.6.0
func (plugin *FakeVolumePlugin) Recycle(pvName string, spec *Spec, eventRecorder recyclerclient.RecycleEventRecorder) error
func (*FakeVolumePlugin) RequiresFSResize ¶ added in v1.11.0
func (plugin *FakeVolumePlugin) RequiresFSResize() bool
func (*FakeVolumePlugin) RequiresRemount ¶ added in v1.3.0
func (plugin *FakeVolumePlugin) RequiresRemount() bool
func (*FakeVolumePlugin) SupportsBulkVolumeVerification ¶ added in v1.6.0
func (plugin *FakeVolumePlugin) SupportsBulkVolumeVerification() bool
func (*FakeVolumePlugin) SupportsMountOption ¶ added in v1.6.0
func (plugin *FakeVolumePlugin) SupportsMountOption() bool
type MockVolume ¶
func (*MockVolume) GetMetrics ¶
func (_m *MockVolume) GetMetrics() (*Metrics, error)
GetMetrics provides a mock function with given fields:
func (*MockVolume) GetPath ¶
func (_m *MockVolume) GetPath() string
GetPath provides a mock function with given fields: