testing

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2016 License: Apache-2.0, Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindEmptyDirectoryUsageOnTmpfs

func FindEmptyDirectoryUsageOnTmpfs() (*resource.Quantity, error)

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
}

func (*FakeVolume) Attach

func (fv *FakeVolume) Attach() error

func (*FakeVolume) Detach

func (fv *FakeVolume) Detach() error

func (*FakeVolume) GetAttributes

func (_ *FakeVolume) GetAttributes() Attributes

func (*FakeVolume) GetPath

func (fv *FakeVolume) GetPath() string

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

type FakeVolumePlugin

type FakeVolumePlugin struct {
	PluginName             string
	Host                   VolumeHost
	Config                 VolumeConfig
	LastProvisionerOptions VolumeOptions
	NewAttacherCallCount   int
	NewDetacherCallCount   int
}

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(spec *Spec) (Attacher, error)

func (*FakeVolumePlugin) NewBuilder

func (plugin *FakeVolumePlugin) NewBuilder(spec *Spec, pod *api.Pod, opts VolumeOptions) (Builder, error)

func (*FakeVolumePlugin) NewCleaner

func (plugin *FakeVolumePlugin) NewCleaner(volName string, podUID types.UID) (Cleaner, error)

func (*FakeVolumePlugin) NewDeleter

func (plugin *FakeVolumePlugin) NewDeleter(spec *Spec) (Deleter, error)

func (*FakeVolumePlugin) NewDetacher

func (plugin *FakeVolumePlugin) NewDetacher(name string, podUID types.UID) (Detacher, error)

func (*FakeVolumePlugin) NewProvisioner

func (plugin *FakeVolumePlugin) NewProvisioner(options VolumeOptions) (Provisioner, error)

func (*FakeVolumePlugin) NewRecycler

func (plugin *FakeVolumePlugin) NewRecycler(spec *Spec) (Recycler, error)

type MockVolume

type MockVolume struct {
	mock.Mock
}

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:

Jump to

Keyboard shortcuts

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