test

package
v0.0.0-...-e6acfc1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTestContainer

func BuildTestContainer(containerName, cpu, mem string) apiv1.Container

BuildTestContainer creates container with specified resources

func BuildTestPod

func BuildTestPod(name, containerName, cpu, mem string, creator runtime.Object) *apiv1.Pod

BuildTestPod creates a pod with specified resources.

func BuildTestPolicy

func BuildTestPolicy(containerName, minCpu, maxCpu, minMemory, maxMemory string) *apimock.ResourcesPolicy

BuildTestPolicy creates ResourcesPolicy with specified constraints

func BuildTestVerticalPodAutoscaler

func BuildTestVerticalPodAutoscaler(containerName, minCpu, maxCpu, minMemory, maxMemory string, selector string) *apimock.VerticalPodAutoscaler

BuildTestVerticalPodAutoscaler creates VerticalPodAutoscaler withs specified policy constraints

func Recommendation

func Recommendation(containerName, cpu, mem string) *apimock.Recommendation

Recommendation creates Recommendation with specified container name and resources

func RefJSON

func RefJSON(o runtime.Object) string

RefJSON builds string reference to

Types

type PodListerMock

type PodListerMock struct {
	mock.Mock
}

PodListerMock is a mock of PodLister

func (*PodListerMock) List

func (m *PodListerMock) List(selector labels.Selector) (ret []*apiv1.Pod, err error)

List is a mock implementation of PodLister.List

func (*PodListerMock) Pods

func (m *PodListerMock) Pods(namespace string) v1.PodNamespaceLister

Pods is a mock implementation of PodLister.Pods

type PodsEvictionRestrictionMock

type PodsEvictionRestrictionMock struct {
	mock.Mock
}

PodsEvictionRestrictionMock is a mock of PodsEvictionRestriction

func (*PodsEvictionRestrictionMock) CanEvict

func (m *PodsEvictionRestrictionMock) CanEvict(pod *apiv1.Pod) bool

CanEvict is a mock implementation of PodsEvictionRestriction.CanEvict

func (*PodsEvictionRestrictionMock) Evict

func (m *PodsEvictionRestrictionMock) Evict(pod *apiv1.Pod) error

Evict is a mock implementation of PodsEvictionRestriction.Evict

type RecommenderAPIMock

type RecommenderAPIMock struct {
	mock.Mock
}

RecommenderAPIMock is a mock of RecommenderAPI

func (*RecommenderAPIMock) GetRecommendation

func (m *RecommenderAPIMock) GetRecommendation(spec *apiv1.PodSpec) (*apimock.Recommendation, error)

GetRecommendation is mock implementation of RecommenderAPI.GetRecommendation

type RecommenderMock

type RecommenderMock struct {
	mock.Mock
}

RecommenderMock is a mock of Recommender

func (*RecommenderMock) Get

Get is a mock implementation of Recommender.Get

type VerticalPodAutoscalerListerMock

type VerticalPodAutoscalerListerMock struct {
	mock.Mock
}

VerticalPodAutoscalerListerMock is a mock of VerticalPodAutoscalerLister

func (*VerticalPodAutoscalerListerMock) List

List is a mock implementation of VerticalPodAutoscalerLister.List

Jump to

Keyboard shortcuts

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