testing

package
v1.31.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeMirrorClient

type FakeMirrorClient struct {
	// contains filtered or unexported fields
}

func NewFakeMirrorClient

func NewFakeMirrorClient() *FakeMirrorClient

func (*FakeMirrorClient) CreateMirrorPod

func (fmc *FakeMirrorClient) CreateMirrorPod(pod *v1.Pod) error

func (*FakeMirrorClient) DeleteMirrorPod

func (fmc *FakeMirrorClient) DeleteMirrorPod(podFullName string, _ *types.UID) (bool, error)

TODO (Robert Krawitz): Implement UID checking

func (*FakeMirrorClient) GetCounts

func (fmc *FakeMirrorClient) GetCounts(podFullName string) (int, int)

func (*FakeMirrorClient) GetPods

func (fmc *FakeMirrorClient) GetPods() []string

func (*FakeMirrorClient) HasPod

func (fmc *FakeMirrorClient) HasPod(podFullName string) bool

func (*FakeMirrorClient) NumOfPods

func (fmc *FakeMirrorClient) NumOfPods() int

type MockManager added in v1.8.0

type MockManager struct {
	mock.Mock
}

MockManager is an autogenerated mock type for the Manager type

func NewMockManager added in v1.23.0

func NewMockManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockManager

NewMockManager creates a new instance of MockManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockManager) AddPod added in v1.8.0

func (_m *MockManager) AddPod(_a0 *v1.Pod)

AddPod provides a mock function with given fields: _a0

func (*MockManager) EXPECT added in v1.23.0

func (_m *MockManager) EXPECT() *MockManager_Expecter

func (*MockManager) GetMirrorPodByPod added in v1.8.0

func (_m *MockManager) GetMirrorPodByPod(_a0 *v1.Pod) (*v1.Pod, bool)

GetMirrorPodByPod provides a mock function with given fields: _a0

func (*MockManager) GetPodAndMirrorPod added in v1.28.0

func (_m *MockManager) GetPodAndMirrorPod(_a0 *v1.Pod) (*v1.Pod, *v1.Pod, bool)

GetPodAndMirrorPod provides a mock function with given fields: _a0

func (*MockManager) GetPodByFullName added in v1.8.0

func (_m *MockManager) GetPodByFullName(podFullName string) (*v1.Pod, bool)

GetPodByFullName provides a mock function with given fields: podFullName

func (*MockManager) GetPodByMirrorPod added in v1.8.0

func (_m *MockManager) GetPodByMirrorPod(_a0 *v1.Pod) (*v1.Pod, bool)

GetPodByMirrorPod provides a mock function with given fields: _a0

func (*MockManager) GetPodByName added in v1.8.0

func (_m *MockManager) GetPodByName(namespace string, name string) (*v1.Pod, bool)

GetPodByName provides a mock function with given fields: namespace, name

func (*MockManager) GetPodByUID added in v1.8.0

func (_m *MockManager) GetPodByUID(_a0 types.UID) (*v1.Pod, bool)

GetPodByUID provides a mock function with given fields: _a0

func (*MockManager) GetPods added in v1.8.0

func (_m *MockManager) GetPods() []*v1.Pod

GetPods provides a mock function with given fields:

func (*MockManager) GetPodsAndMirrorPods added in v1.8.0

func (_m *MockManager) GetPodsAndMirrorPods() ([]*v1.Pod, []*v1.Pod, []string)

GetPodsAndMirrorPods provides a mock function with given fields:

func (*MockManager) GetUIDTranslations added in v1.8.0

GetUIDTranslations provides a mock function with given fields:

func (*MockManager) RemovePod added in v1.28.0

func (_m *MockManager) RemovePod(_a0 *v1.Pod)

RemovePod provides a mock function with given fields: _a0

func (*MockManager) SetPods added in v1.8.0

func (_m *MockManager) SetPods(pods []*v1.Pod)

SetPods provides a mock function with given fields: pods

func (*MockManager) TranslatePodUID added in v1.8.0

func (_m *MockManager) TranslatePodUID(uid types.UID) kubelettypes.ResolvedPodUID

TranslatePodUID provides a mock function with given fields: uid

func (*MockManager) UpdatePod added in v1.8.0

func (_m *MockManager) UpdatePod(_a0 *v1.Pod)

UpdatePod provides a mock function with given fields: _a0

type MockManager_AddPod_Call

type MockManager_AddPod_Call struct {
	*mock.Call
}

MockManager_AddPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPod'

func (*MockManager_AddPod_Call) Return

func (*MockManager_AddPod_Call) Run

func (_c *MockManager_AddPod_Call) Run(run func(_a0 *v1.Pod)) *MockManager_AddPod_Call

func (*MockManager_AddPod_Call) RunAndReturn

func (_c *MockManager_AddPod_Call) RunAndReturn(run func(*v1.Pod)) *MockManager_AddPod_Call

type MockManager_Expecter

type MockManager_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockManager_Expecter) AddPod

func (_e *MockManager_Expecter) AddPod(_a0 interface{}) *MockManager_AddPod_Call

AddPod is a helper method to define mock.On call

  • _a0 *v1.Pod

func (*MockManager_Expecter) GetMirrorPodByPod

func (_e *MockManager_Expecter) GetMirrorPodByPod(_a0 interface{}) *MockManager_GetMirrorPodByPod_Call

GetMirrorPodByPod is a helper method to define mock.On call

  • _a0 *v1.Pod

func (*MockManager_Expecter) GetPodAndMirrorPod

func (_e *MockManager_Expecter) GetPodAndMirrorPod(_a0 interface{}) *MockManager_GetPodAndMirrorPod_Call

GetPodAndMirrorPod is a helper method to define mock.On call

  • _a0 *v1.Pod

func (*MockManager_Expecter) GetPodByFullName

func (_e *MockManager_Expecter) GetPodByFullName(podFullName interface{}) *MockManager_GetPodByFullName_Call

GetPodByFullName is a helper method to define mock.On call

  • podFullName string

func (*MockManager_Expecter) GetPodByMirrorPod

func (_e *MockManager_Expecter) GetPodByMirrorPod(_a0 interface{}) *MockManager_GetPodByMirrorPod_Call

GetPodByMirrorPod is a helper method to define mock.On call

  • _a0 *v1.Pod

func (*MockManager_Expecter) GetPodByName

func (_e *MockManager_Expecter) GetPodByName(namespace interface{}, name interface{}) *MockManager_GetPodByName_Call

GetPodByName is a helper method to define mock.On call

  • namespace string
  • name string

func (*MockManager_Expecter) GetPodByUID

func (_e *MockManager_Expecter) GetPodByUID(_a0 interface{}) *MockManager_GetPodByUID_Call

GetPodByUID is a helper method to define mock.On call

  • _a0 types.UID

func (*MockManager_Expecter) GetPods

GetPods is a helper method to define mock.On call

func (*MockManager_Expecter) GetPodsAndMirrorPods

func (_e *MockManager_Expecter) GetPodsAndMirrorPods() *MockManager_GetPodsAndMirrorPods_Call

GetPodsAndMirrorPods is a helper method to define mock.On call

func (*MockManager_Expecter) GetUIDTranslations

GetUIDTranslations is a helper method to define mock.On call

func (*MockManager_Expecter) RemovePod

func (_e *MockManager_Expecter) RemovePod(_a0 interface{}) *MockManager_RemovePod_Call

RemovePod is a helper method to define mock.On call

  • _a0 *v1.Pod

func (*MockManager_Expecter) SetPods

func (_e *MockManager_Expecter) SetPods(pods interface{}) *MockManager_SetPods_Call

SetPods is a helper method to define mock.On call

  • pods []*v1.Pod

func (*MockManager_Expecter) TranslatePodUID

func (_e *MockManager_Expecter) TranslatePodUID(uid interface{}) *MockManager_TranslatePodUID_Call

TranslatePodUID is a helper method to define mock.On call

  • uid types.UID

func (*MockManager_Expecter) UpdatePod

func (_e *MockManager_Expecter) UpdatePod(_a0 interface{}) *MockManager_UpdatePod_Call

UpdatePod is a helper method to define mock.On call

  • _a0 *v1.Pod

type MockManager_GetMirrorPodByPod_Call

type MockManager_GetMirrorPodByPod_Call struct {
	*mock.Call
}

MockManager_GetMirrorPodByPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMirrorPodByPod'

func (*MockManager_GetMirrorPodByPod_Call) Return

func (*MockManager_GetMirrorPodByPod_Call) Run

func (*MockManager_GetMirrorPodByPod_Call) RunAndReturn

type MockManager_GetPodAndMirrorPod_Call

type MockManager_GetPodAndMirrorPod_Call struct {
	*mock.Call
}

MockManager_GetPodAndMirrorPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodAndMirrorPod'

func (*MockManager_GetPodAndMirrorPod_Call) Return

func (_c *MockManager_GetPodAndMirrorPod_Call) Return(_a0 *v1.Pod, mirrorPod *v1.Pod, wasMirror bool) *MockManager_GetPodAndMirrorPod_Call

func (*MockManager_GetPodAndMirrorPod_Call) Run

func (*MockManager_GetPodAndMirrorPod_Call) RunAndReturn

type MockManager_GetPodByFullName_Call

type MockManager_GetPodByFullName_Call struct {
	*mock.Call
}

MockManager_GetPodByFullName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodByFullName'

func (*MockManager_GetPodByFullName_Call) Return

func (*MockManager_GetPodByFullName_Call) Run

func (*MockManager_GetPodByFullName_Call) RunAndReturn

type MockManager_GetPodByMirrorPod_Call

type MockManager_GetPodByMirrorPod_Call struct {
	*mock.Call
}

MockManager_GetPodByMirrorPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodByMirrorPod'

func (*MockManager_GetPodByMirrorPod_Call) Return

func (*MockManager_GetPodByMirrorPod_Call) Run

func (*MockManager_GetPodByMirrorPod_Call) RunAndReturn

type MockManager_GetPodByName_Call

type MockManager_GetPodByName_Call struct {
	*mock.Call
}

MockManager_GetPodByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodByName'

func (*MockManager_GetPodByName_Call) Return

func (*MockManager_GetPodByName_Call) Run

func (_c *MockManager_GetPodByName_Call) Run(run func(namespace string, name string)) *MockManager_GetPodByName_Call

func (*MockManager_GetPodByName_Call) RunAndReturn

type MockManager_GetPodByUID_Call

type MockManager_GetPodByUID_Call struct {
	*mock.Call
}

MockManager_GetPodByUID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodByUID'

func (*MockManager_GetPodByUID_Call) Return

func (*MockManager_GetPodByUID_Call) Run

func (*MockManager_GetPodByUID_Call) RunAndReturn

type MockManager_GetPodsAndMirrorPods_Call

type MockManager_GetPodsAndMirrorPods_Call struct {
	*mock.Call
}

MockManager_GetPodsAndMirrorPods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodsAndMirrorPods'

func (*MockManager_GetPodsAndMirrorPods_Call) Return

func (_c *MockManager_GetPodsAndMirrorPods_Call) Return(allPods []*v1.Pod, allMirrorPods []*v1.Pod, orphanedMirrorPodFullnames []string) *MockManager_GetPodsAndMirrorPods_Call

func (*MockManager_GetPodsAndMirrorPods_Call) Run

func (*MockManager_GetPodsAndMirrorPods_Call) RunAndReturn

type MockManager_GetPods_Call

type MockManager_GetPods_Call struct {
	*mock.Call
}

MockManager_GetPods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPods'

func (*MockManager_GetPods_Call) Return

func (*MockManager_GetPods_Call) Run

func (*MockManager_GetPods_Call) RunAndReturn

func (_c *MockManager_GetPods_Call) RunAndReturn(run func() []*v1.Pod) *MockManager_GetPods_Call

type MockManager_GetUIDTranslations_Call

type MockManager_GetUIDTranslations_Call struct {
	*mock.Call
}

MockManager_GetUIDTranslations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUIDTranslations'

func (*MockManager_GetUIDTranslations_Call) Run

type MockManager_RemovePod_Call

type MockManager_RemovePod_Call struct {
	*mock.Call
}

MockManager_RemovePod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemovePod'

func (*MockManager_RemovePod_Call) Return

func (*MockManager_RemovePod_Call) Run

func (*MockManager_RemovePod_Call) RunAndReturn

func (_c *MockManager_RemovePod_Call) RunAndReturn(run func(*v1.Pod)) *MockManager_RemovePod_Call

type MockManager_SetPods_Call

type MockManager_SetPods_Call struct {
	*mock.Call
}

MockManager_SetPods_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPods'

func (*MockManager_SetPods_Call) Return

func (*MockManager_SetPods_Call) Run

func (_c *MockManager_SetPods_Call) Run(run func(pods []*v1.Pod)) *MockManager_SetPods_Call

func (*MockManager_SetPods_Call) RunAndReturn

func (_c *MockManager_SetPods_Call) RunAndReturn(run func([]*v1.Pod)) *MockManager_SetPods_Call

type MockManager_TranslatePodUID_Call

type MockManager_TranslatePodUID_Call struct {
	*mock.Call
}

MockManager_TranslatePodUID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TranslatePodUID'

func (*MockManager_TranslatePodUID_Call) Return

func (*MockManager_TranslatePodUID_Call) Run

func (*MockManager_TranslatePodUID_Call) RunAndReturn

type MockManager_UpdatePod_Call

type MockManager_UpdatePod_Call struct {
	*mock.Call
}

MockManager_UpdatePod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePod'

func (*MockManager_UpdatePod_Call) Return

func (*MockManager_UpdatePod_Call) Run

func (*MockManager_UpdatePod_Call) RunAndReturn

func (_c *MockManager_UpdatePod_Call) RunAndReturn(run func(*v1.Pod)) *MockManager_UpdatePod_Call

Jump to

Keyboard shortcuts

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