package testing
import "k8s.io/kubernetes/pkg/volume/testing"
Index ¶
- func FindEmptyDirectoryUsageOnTmpfs() (*resource.Quantity, error)
- func NewFakeRecycler(spec *Spec, host VolumeHost, config VolumeConfig) (Recycler, error)
- func NewFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin) *fakeVolumeHost
- func ProbeVolumePlugins(config VolumeConfig) []VolumePlugin
- type FakeDeleter
- type FakeProvisioner
- func (fc *FakeProvisioner) NewPersistentVolumeTemplate() (*api.PersistentVolume, error)
- func (fc *FakeProvisioner) Provision(pv *api.PersistentVolume) error
- type FakeVolume
- func (fv *FakeVolume) Attach(spec *Spec, hostName string) error
- func (fv *FakeVolume) Detach(deviceMountPath string, hostName string) error
- func (_ *FakeVolume) GetAttributes() Attributes
- func (fv *FakeVolume) GetDeviceMountPath(host VolumeHost, spec *Spec) string
- func (fv *FakeVolume) GetPath() string
- func (fv *FakeVolume) MountDevice(spec *Spec, devicePath string, deviceMountPath string, mounter mount.Interface) error
- func (fv *FakeVolume) SetUp(fsGroup *int64) error
- func (fv *FakeVolume) SetUpAt(dir string, fsGroup *int64) error
- func (fv *FakeVolume) TearDown() error
- func (fv *FakeVolume) TearDownAt(dir string) error
- func (fv *FakeVolume) UnmountDevice(globalMountPath string, mounter mount.Interface) error
- func (fv *FakeVolume) WaitForAttach(spec *Spec, spectimeout time.Duration) (string, error)
- func (fv *FakeVolume) WaitForDetach(devicePath string, timeout time.Duration) error
- type FakeVolumePlugin
- func (plugin *FakeVolumePlugin) CanSupport(spec *Spec) bool
- func (plugin *FakeVolumePlugin) GetAccessModes() []api.PersistentVolumeAccessMode
- func (plugin *FakeVolumePlugin) Init(host VolumeHost) error
- func (plugin *FakeVolumePlugin) Name() string
- func (plugin *FakeVolumePlugin) NewAttacher() (Attacher, error)
- func (plugin *FakeVolumePlugin) NewDeleter(spec *Spec) (Deleter, error)
- func (plugin *FakeVolumePlugin) NewDetacher() (Detacher, error)
- func (plugin *FakeVolumePlugin) NewMounter(spec *Spec, pod *api.Pod, opts VolumeOptions) (Mounter, error)
- func (plugin *FakeVolumePlugin) NewProvisioner(options VolumeOptions) (Provisioner, error)
- func (plugin *FakeVolumePlugin) NewRecycler(spec *Spec) (Recycler, error)
- func (plugin *FakeVolumePlugin) NewUnmounter(volName string, podUID types.UID) (Unmounter, error)
- type MockVolume
Functions ¶
func FindEmptyDirectoryUsageOnTmpfs ¶
FindEmptyDirectoryUsageOnTmpfs finds the expected usage of an empty directory existing on a tmpfs filesystem on this system.
func NewFakeRecycler ¶
func NewFakeRecycler(spec *Spec, host VolumeHost, config VolumeConfig) (Recycler, error)
func NewFakeVolumeHost ¶
func NewFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin) *fakeVolumeHost
func ProbeVolumePlugins ¶
func ProbeVolumePlugins(config VolumeConfig) []VolumePlugin
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 FakeProvisioner ¶
type FakeProvisioner struct { Options VolumeOptions Host VolumeHost }
func (*FakeProvisioner) NewPersistentVolumeTemplate ¶
func (fc *FakeProvisioner) NewPersistentVolumeTemplate() (*api.PersistentVolume, error)
func (*FakeProvisioner) Provision ¶
func (fc *FakeProvisioner) Provision(pv *api.PersistentVolume) error
type FakeVolume ¶
type FakeVolume struct { PodUID types.UID VolName string Plugin *FakeVolumePlugin MetricsNil SetUpCallCount int TearDownCallCount int AttachCallCount int DetachCallCount int WaitForAttachCallCount int WaitForDetachCallCount int MountDeviceCallCount int UnmountDeviceCallCount int GetDeviceMountPathCallCount int }
func (*FakeVolume) Attach ¶
func (fv *FakeVolume) Attach(spec *Spec, hostName string) error
func (*FakeVolume) Detach ¶
func (fv *FakeVolume) Detach(deviceMountPath string, hostName string) error
func (*FakeVolume) GetAttributes ¶
func (_ *FakeVolume) GetAttributes() Attributes
func (*FakeVolume) GetDeviceMountPath ¶
func (fv *FakeVolume) GetDeviceMountPath(host VolumeHost, spec *Spec) string
func (*FakeVolume) GetPath ¶
func (fv *FakeVolume) GetPath() string
func (*FakeVolume) MountDevice ¶
func (fv *FakeVolume) MountDevice(spec *Spec, devicePath string, deviceMountPath string, mounter mount.Interface) error
func (*FakeVolume) SetUp ¶
func (fv *FakeVolume) SetUp(fsGroup *int64) error
func (*FakeVolume) SetUpAt ¶
func (fv *FakeVolume) SetUpAt(dir string, fsGroup *int64) error
func (*FakeVolume) TearDown ¶
func (fv *FakeVolume) TearDown() error
func (*FakeVolume) TearDownAt ¶
func (fv *FakeVolume) TearDownAt(dir string) error
func (*FakeVolume) UnmountDevice ¶
func (fv *FakeVolume) UnmountDevice(globalMountPath string, mounter mount.Interface) error
func (*FakeVolume) WaitForAttach ¶
func (fv *FakeVolume) WaitForAttach(spec *Spec, spectimeout time.Duration) (string, error)
func (*FakeVolume) WaitForDetach ¶
func (fv *FakeVolume) WaitForDetach(devicePath string, timeout time.Duration) error
type FakeVolumePlugin ¶
type FakeVolumePlugin struct { PluginName string Host VolumeHost Config VolumeConfig LastProvisionerOptions VolumeOptions NewAttacherCallCount int NewDetacherCallCount int Mounters []*FakeVolume Unmounters []*FakeVolume Attachers []*FakeVolume Detachers []*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) GetAccessModes ¶
func (plugin *FakeVolumePlugin) GetAccessModes() []api.PersistentVolumeAccessMode
func (*FakeVolumePlugin) Init ¶
func (plugin *FakeVolumePlugin) Init(host VolumeHost) error
func (*FakeVolumePlugin) Name ¶
func (plugin *FakeVolumePlugin) Name() string
func (*FakeVolumePlugin) NewAttacher ¶
func (plugin *FakeVolumePlugin) NewAttacher() (Attacher, error)
func (*FakeVolumePlugin) NewDeleter ¶
func (plugin *FakeVolumePlugin) NewDeleter(spec *Spec) (Deleter, error)
func (*FakeVolumePlugin) NewDetacher ¶
func (plugin *FakeVolumePlugin) NewDetacher() (Detacher, error)
func (*FakeVolumePlugin) NewMounter ¶
func (plugin *FakeVolumePlugin) NewMounter(spec *Spec, pod *api.Pod, opts VolumeOptions) (Mounter, error)
func (*FakeVolumePlugin) NewProvisioner ¶
func (plugin *FakeVolumePlugin) NewProvisioner(options VolumeOptions) (Provisioner, error)
func (*FakeVolumePlugin) NewRecycler ¶
func (plugin *FakeVolumePlugin) NewRecycler(spec *Spec) (Recycler, error)
func (*FakeVolumePlugin) NewUnmounter ¶
func (plugin *FakeVolumePlugin) NewUnmounter(volName string, podUID types.UID) (Unmounter, error)
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:
Source Files ¶
mock_volume.go testing.go
- Version
- v1.3.0-alpha.4
- Published
- May 17, 2016
- Platform
- js/wasm
- Imports
- 18 packages
- Last checked
- 3 minutes ago –
Tools for package owners.