mock

package
v0.0.0-...-88490aa Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mock provides a mock implementation for dbmanager. It stores resources in a set of public maps that test programs can use to verify correctness.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(invalidRVs bool) dbmanager.DBManager

Types

type MockManager

type MockManager struct {
	PodForUID map[types.UID]ResourceAttrs
	PVForUID  map[types.UID]ResourceAttrs
	PVCForUID map[types.UID]ResourceAttrs
	Deletions int
	// contains filtered or unexported fields
}

func (*MockManager) BindPVC

func (m *MockManager) BindPVC(pvUID types.UID, pvcUID types.UID,
	bindTime unversioned.Time, rv string)

func (*MockManager) DeletePV

func (m *MockManager) DeletePV(uid types.UID, deleteTime unversioned.Time,
	rv string)

func (*MockManager) DeletePVC

func (m *MockManager) DeletePVC(uid types.UID, deleteTime unversioned.Time,
	watcherNS, rv string)

func (*MockManager) DeletePod

func (m *MockManager) DeletePod(uid types.UID, deleteTime unversioned.Time,
	watcherNS, rv string)

func (*MockManager) Destroy

func (m *MockManager) Destroy()

func (*MockManager) GetRV

func (m *MockManager) GetRV(resource resources.ResourceType,
	namespace string) string

func (*MockManager) InsertISCSI

func (m *MockManager) InsertISCSI(
	targetPortal, iqn string, lun int, fsType string,
) int

func (*MockManager) InsertNFS

func (m *MockManager) InsertNFS(ipAddr, path string) int

func (*MockManager) InsertPV

func (m *MockManager) InsertPV(
	uid types.UID, name string, createTime unversioned.Time, backendID int,
	backendType dbmanager.Table, storage int64,
	accessModes []api.PersistentVolumeAccessMode, json, rv string,
)

func (*MockManager) InsertPVC

func (m *MockManager) InsertPVC(uid types.UID, name string,
	createTime unversioned.Time, namespace string, storage int64,
	accessModes []api.PersistentVolumeAccessMode,
	json, watcherNS, rv string)

func (*MockManager) InsertPod

func (m *MockManager) InsertPod(uid types.UID, name string,
	createTime unversioned.Time, namespace string,
	containers []resources.ContainerDesc,
	json, watcherNS, rv string)

func (*MockManager) UpdatePV

func (m *MockManager) UpdatePV(
	uid types.UID, backendID int, backendType dbmanager.Table, storage int64,
	accessModes []api.PersistentVolumeAccessMode, json, rv string,
)

func (*MockManager) UpdatePVC

func (m *MockManager) UpdatePVC(uid types.UID, storage int64,
	accessModes []api.PersistentVolumeAccessMode,
	json, watcherNS, rv string)

func (*MockManager) ValidateConnection

func (m *MockManager) ValidateConnection() error

type PVAttrs

type PVAttrs struct {
	Name       string
	CreateTime unversioned.Time
	NFSID      int
	ISCSIID    int
	UID        types.UID
	Storage    int64
}

func (*PVAttrs) GetName

func (p *PVAttrs) GetName() string

func (*PVAttrs) GetUID

func (p *PVAttrs) GetUID() types.UID

type PVCAttrs

type PVCAttrs struct {
	Name       string
	CreateTime unversioned.Time
	Namespace  string
	UID        types.UID
	Storage    int64
}

func (*PVCAttrs) GetName

func (p *PVCAttrs) GetName() string

func (*PVCAttrs) GetUID

func (p *PVCAttrs) GetUID() types.UID

type PodAttrs

type PodAttrs struct {
	Name       string
	CreateTime unversioned.Time
	Namespace  string
	UID        types.UID
	Containers []resources.ContainerDesc
}

func (*PodAttrs) GetName

func (p *PodAttrs) GetName() string

func (*PodAttrs) GetUID

func (p *PodAttrs) GetUID() types.UID

type ResourceAttrs

type ResourceAttrs interface {
	GetName() string
	GetUID() types.UID
}

Jump to

Keyboard shortcuts

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