fake

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fake provides stubs for testing relevant to the Custom Pod Autoscaler packages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Execute

type Execute struct {
	ExecuteWithValueReactor func(method *config.Method, value string) (string, error)
	GetTypeReactor          func() string
}

Execute (fake) allows inserting logic into an executer for testing

func (*Execute) ExecuteWithValue

func (f *Execute) ExecuteWithValue(method *config.Method, value string) (string, error)

ExecuteWithValue calls the fake Execute reactor method provided

func (*Execute) GetType

func (f *Execute) GetType() string

GetType calls the fake Execute reactor method provided

type Gatherer added in v2.7.0

type Gatherer struct {
	GatherReactor func(specs []autoscalingv2.MetricSpec, namespace string, podSelector labels.Selector) ([]*metrics.Metric, error)
}

Gather (fake) provides a way to insert functionality into a Gatherer

func (*Gatherer) Gather added in v2.7.0

func (f *Gatherer) Gather(specs []autoscalingv2.MetricSpec, namespace string, podSelector labels.Selector) ([]*metrics.Metric, error)

GetMetrics calls the fake Gather function

type ResourceClient

type ResourceClient struct {
	GetReactor func(apiVersion string, kind string, name string, namespace string) (*unstructured.Unstructured, error)
}

ResourceClient (fake) allows inserting logic into a resource client for testing

func (*ResourceClient) Get

func (u *ResourceClient) Get(apiVersion string, kind string, name string, namespace string) (*unstructured.Unstructured, error)

Get calls the fake ResourceClient reactor method provided

type Scaler

type Scaler struct {
	ScaleReactor               func(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error)
	GetScaleSubResourceReactor func(apiVersion string, kind string, namespace string, name string) (*autoscalingv1.Scale, error)
}

Scaler (fake) allows inserting logic into a scaler for testing

func (*Scaler) GetScaleSubResource added in v2.5.0

func (s *Scaler) GetScaleSubResource(apiVersion string, kind string, namespace string, name string) (*autoscalingv1.Scale, error)

GetScaleSubResource calls the fake GetScaleSubResource reactor method provided

func (*Scaler) Scale

func (s *Scaler) Scale(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error)

Scale calls the fake Scaler reactor method provided

Jump to

Keyboard shortcuts

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