test

package
v0.0.0-...-78e9714 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: Apache-2.0 Imports: 10 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, creatorObjectMeta *metav1.ObjectMeta, creatorTypeMeta *metav1.TypeMeta) *apiv1.Pod

BuildTestPod creates a pod with specified resources.

func BuildTestPolicy

func BuildTestPolicy(containerName, minCpu, maxCpu, minMemory, maxMemory string) *vpa_types.PodResourcePolicy

BuildTestPolicy creates ResourcesPolicy with specified constraints

func BuildTestVerticalPodAutoscaler

func BuildTestVerticalPodAutoscaler(containerName, targetCpu, minCpu, maxCpu, targetMemory, minMemory, maxMemory string, selector string) *vpa_types.VerticalPodAutoscaler

BuildTestVerticalPodAutoscaler creates VerticalPodAutoscaler withs specified policy constraints

func Recommendation

func Recommendation(containerName, cpu, mem string) *vpa_types.RecommendedPodResources

Recommendation creates Recommendation with specified container name and resources

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) (*vpa_types.RecommendedPodResources, 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

func (*VerticalPodAutoscalerListerMock) VerticalPodAutoscalers

VerticalPodAutoscalers is not implemented for this mock

Jump to

Keyboard shortcuts

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