test_util

package
v0.0.0-...-5e3b14e Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMocks

func GenerateMocks() (clientset *MockClientset, policy *PolicyV1beta1Client, core *MockCoreV1, pods *MockPods, nodes *MockNodes)

func GeneratePodList

func GeneratePodList(count int, nodeName string, countWithTolerations int) *v1.PodList

Types

type Evictions

type Evictions struct {
	Tries        int
	EvictSuccess []bool
	EvictCalled  bool
	T            *testing.T
	// contains filtered or unexported fields
}

func NewEvictions

func NewEvictions(c *PolicyV1beta1Client, namespace string, t *testing.T) *Evictions

func (*Evictions) Evict

func (c *Evictions) Evict(eviction *apiv1beta1.Eviction) error

type MockClientset

type MockClientset struct {
	fake.Clientset
	PolicyItem *PolicyV1beta1Client
	CoreItem   *MockCoreV1
}

func NewMockClientset

func NewMockClientset() *MockClientset

func (*MockClientset) CoreV1

func (mc *MockClientset) CoreV1() corev1.CoreV1Interface

func (*MockClientset) PolicyV1beta1

func (*MockClientset) SetCore

func (mc *MockClientset) SetCore(m *MockCoreV1)

func (*MockClientset) SetPolicyV1beta1

func (mc *MockClientset) SetPolicyV1beta1(p *PolicyV1beta1Client)

type MockCoreV1

type MockCoreV1 struct {
	fakecorev1.FakeCoreV1
	NodesCalled bool
	NodesResult *MockNodes
	PodsCalled  bool
	PodsResult  *MockPods
}

func NewMockCoreV1

func NewMockCoreV1() *MockCoreV1

func (*MockCoreV1) Nodes

func (m *MockCoreV1) Nodes() corev1.NodeInterface

func (*MockCoreV1) Pods

func (m *MockCoreV1) Pods(name string) corev1.PodInterface

func (*MockCoreV1) SetNodes

func (m *MockCoreV1) SetNodes(result *MockNodes)

func (*MockCoreV1) SetPods

func (m *MockCoreV1) SetPods(result *MockPods)

type MockNodes

type MockNodes struct {
	fakecorev1.FakeNodes
	GetCalled          bool
	UpdateCalled       bool
	GetReturnResult    *v1.Node
	GetReturnError     error
	UpdateReturnResult *v1.Node
	UpdateReturnError  error
}

func NewMockNodes

func NewMockNodes() *MockNodes

func (*MockNodes) Get

func (m *MockNodes) Get(name string, options meta_v1.GetOptions) (result *v1.Node, err error)

func (*MockNodes) SetupGet

func (m *MockNodes) SetupGet(result *v1.Node, err error)

func (*MockNodes) SetupUpdate

func (m *MockNodes) SetupUpdate(result *v1.Node, err error)

func (*MockNodes) Update

func (m *MockNodes) Update(node *v1.Node) (result *v1.Node, err error)

type MockPods

type MockPods struct {
	fakecorev1.FakePods
	ListCalled       bool
	ListReturnResult *v1.PodList
	ListReturnError  error
}

func NewMockPods

func NewMockPods() *MockPods

func (*MockPods) List

func (m *MockPods) List(opts meta_v1.ListOptions) (result *v1.PodList, err error)

func (*MockPods) SetupList

func (m *MockPods) SetupList(result *v1.PodList, err error)

type PolicyV1beta1Client

type PolicyV1beta1Client struct {
	EvictionsItem *Evictions
	// contains filtered or unexported fields
}

func NewPolicyV1beta1Client

func NewPolicyV1beta1Client() *PolicyV1beta1Client

func (*PolicyV1beta1Client) Evictions

func (*PolicyV1beta1Client) PodDisruptionBudgets

func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) policyv1beta1.PodDisruptionBudgetInterface

func (*PolicyV1beta1Client) RESTClient

func (c *PolicyV1beta1Client) RESTClient() rest.Interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳