Documentation ¶
Index ¶
- func BuildTestContainer(containerName, cpu, mem string) apiv1.Container
- func BuildTestPod(name, containerName, cpu, mem string, creatorObjectMeta *metav1.ObjectMeta, ...) *apiv1.Pod
- func BuildTestPolicy(containerName, minCPU, maxCPU, minMemory, maxMemory string) *vpa_types.PodResourcePolicy
- func Resources(cpu, mem string) apiv1.ResourceList
- type FakeRecommendationProcessor
- type PodListerMock
- type PodsEvictionRestrictionMock
- type RecommendationBuilder
- type RecommendationProcessorMock
- type RecommenderAPIMock
- type RecommenderMock
- type VerticalPodAutoscalerBuilder
- type VerticalPodAutoscalerListerMock
- func (m *VerticalPodAutoscalerListerMock) Get(name string) (*vpa_types.VerticalPodAutoscaler, error)
- func (m *VerticalPodAutoscalerListerMock) List(selector labels.Selector) (ret []*vpa_types.VerticalPodAutoscaler, err error)
- func (m *VerticalPodAutoscalerListerMock) VerticalPodAutoscalers(namespace string) vpa_lister.VerticalPodAutoscalerNamespaceLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTestContainer ¶
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 Resources ¶
func Resources(cpu, mem string) apiv1.ResourceList
Resources creates a ResourceList with given amount of cpu and memory.
Types ¶
type FakeRecommendationProcessor ¶
type FakeRecommendationProcessor struct{}
FakeRecommendationProcessor is a dummy implementation of RecommendationProcessor
func (*FakeRecommendationProcessor) Apply ¶
func (f *FakeRecommendationProcessor) Apply(podRecommendation *vpa_types.RecommendedPodResources, policy *vpa_types.PodResourcePolicy, pod *apiv1.Pod) (*vpa_types.RecommendedPodResources, error)
Apply is a dummy implementation of RecommendationProcessor.Apply which returns provided podRecommendation
type PodListerMock ¶
PodListerMock is a mock of PodLister
func (*PodListerMock) Get ¶
func (m *PodListerMock) Get(name string) (*apiv1.Pod, error)
Get is not implemented for this mock
func (*PodListerMock) Pods ¶
func (m *PodListerMock) Pods(namespace string) v1.PodNamespaceLister
Pods is a mock implementation of PodLister.Pods
type PodsEvictionRestrictionMock ¶
PodsEvictionRestrictionMock is a mock of PodsEvictionRestriction
type RecommendationBuilder ¶
type RecommendationBuilder interface { WithContainer(containerName string) RecommendationBuilder WithTarget(cpu, memory string) RecommendationBuilder WithLowerBound(cpu, memory string) RecommendationBuilder WithUpperBound(cpu, memory string) RecommendationBuilder Get() *vpa_types.RecommendedPodResources }
RecommendationBuilder helps building test instances of RecommendedPodResources.
func Recommendation ¶
func Recommendation() RecommendationBuilder
Recommendation returns a new RecommendationBuilder.
type RecommendationProcessorMock ¶
RecommendationProcessorMock is mock implementation of RecommendationProcessor
func (*RecommendationProcessorMock) Apply ¶
func (m *RecommendationProcessorMock) Apply(podRecommendation *vpa_types.RecommendedPodResources, policy *vpa_types.PodResourcePolicy, pod *apiv1.Pod) (*vpa_types.RecommendedPodResources, error)
Apply is a mock implementation of RecommendationProcessor.Apply
type RecommenderAPIMock ¶
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 ¶
RecommenderMock is a mock of Recommender
func (*RecommenderMock) Get ¶
func (m *RecommenderMock) Get(spec *apiv1.PodSpec) (*vpa_types.RecommendedPodResources, error)
Get is a mock implementation of Recommender.Get
type VerticalPodAutoscalerBuilder ¶
type VerticalPodAutoscalerBuilder interface { WithName(vpaName string) VerticalPodAutoscalerBuilder WithContainer(containerName string) VerticalPodAutoscalerBuilder WithNamespace(namespace string) VerticalPodAutoscalerBuilder WithSelector(labelSelector string) VerticalPodAutoscalerBuilder WithUpdateMode(updateMode vpa_types.UpdateMode) VerticalPodAutoscalerBuilder WithCreationTimestamp(timestamp time.Time) VerticalPodAutoscalerBuilder WithMinAllowed(cpu, memory string) VerticalPodAutoscalerBuilder WithMaxAllowed(cpu, memory string) VerticalPodAutoscalerBuilder WithTarget(cpu, memory string) VerticalPodAutoscalerBuilder WithLowerBound(cpu, memory string) VerticalPodAutoscalerBuilder WithUpperBound(cpu, memory string) VerticalPodAutoscalerBuilder Get() *vpa_types.VerticalPodAutoscaler }
VerticalPodAutoscalerBuilder helps building test instances of VerticalPodAutoscaler.
func VerticalPodAutoscaler ¶
func VerticalPodAutoscaler() VerticalPodAutoscalerBuilder
VerticalPodAutoscaler returns a new VerticalPodAutoscalerBuilder.
type VerticalPodAutoscalerListerMock ¶
VerticalPodAutoscalerListerMock is a mock of VerticalPodAutoscalerLister or VerticalPodAutoscalerNamespaceLister - the crucial List method is the same.
func (*VerticalPodAutoscalerListerMock) Get ¶
func (m *VerticalPodAutoscalerListerMock) Get(name string) (*vpa_types.VerticalPodAutoscaler, error)
Get is not implemented for this mock
func (*VerticalPodAutoscalerListerMock) List ¶
func (m *VerticalPodAutoscalerListerMock) List(selector labels.Selector) (ret []*vpa_types.VerticalPodAutoscaler, err error)
List is a mock implementation of VerticalPodAutoscalerLister.List
func (*VerticalPodAutoscalerListerMock) VerticalPodAutoscalers ¶
func (m *VerticalPodAutoscalerListerMock) VerticalPodAutoscalers(namespace string) vpa_lister.VerticalPodAutoscalerNamespaceLister
VerticalPodAutoscalers is a mock implementation of returning a lister for namespace.