Documentation ¶
Overview ¶
Package fake provides stubs for testing relevant to the Custom Pod Autoscaler packages
Index ¶
- type Execute
- type ExternalGatherer
- type Gather
- type MetricClient
- func (f *MetricClient) GetExternalMetric(metricName string, namespace string, selector labels.Selector) ([]int64, time.Time, error)
- func (f *MetricClient) GetObjectMetric(metricName string, namespace string, ...) (int64, time.Time, error)
- func (f *MetricClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, ...) (metricsclient.PodMetricsInfo, time.Time, error)
- func (f *MetricClient) GetResourceMetric(resource corev1.ResourceName, namespace string, selector labels.Selector, ...) (metricsclient.PodMetricsInfo, time.Time, error)
- type ObjectGatherer
- type PodLister
- type PodNamespaceLister
- type PodReadyCounter
- type PodsGatherer
- type ResourceClient
- type ResourceGatherer
- type Scaler
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 ¶
ExecuteWithValue calls the fake Execute reactor method provided
type ExternalGatherer ¶ added in v1.1.0
type ExternalGatherer struct { GetMetricReactor func(metricName, namespace string, metricSelector *metav1.LabelSelector, podSelector labels.Selector) (*external.Metric, error) GetPerPodMetricReactor func(metricName, namespace string, metricSelector *metav1.LabelSelector) (*external.Metric, error) }
ExternalGatherer (fake) provides a way to insert functionality into an ExternalGatherer
func (*ExternalGatherer) GetMetric ¶ added in v1.1.0
func (f *ExternalGatherer) GetMetric(metricName, namespace string, metricSelector *metav1.LabelSelector, podSelector labels.Selector) (*external.Metric, error)
GetMetric calls the fake ExternalGatherer function
func (*ExternalGatherer) GetPerPodMetric ¶ added in v1.1.0
func (f *ExternalGatherer) GetPerPodMetric(metricName, namespace string, metricSelector *metav1.LabelSelector) (*external.Metric, error)
GetPerPodMetric calls the fake ExternalGatherer function
type Gather ¶ added in v1.1.0
type Gather struct {
GetMetricsReactor func(resource metav1.Object, specs []measure.MetricSpec, namespace string) ([]*measure.Metric, error)
}
Gather (fake) provides a way to insert functionality into a Gatherer
type MetricClient ¶ added in v1.1.0
type MetricClient struct { GetResourceMetricReactor func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) GetRawMetricReactor func(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error) GetObjectMetricReactor func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) GetExternalMetricReactor func(metricName string, namespace string, selector labels.Selector) ([]int64, time.Time, error) }
MetricClient (fake) provides a way to insert functionality into a MetricClient
func (*MetricClient) GetExternalMetric ¶ added in v1.1.0
func (f *MetricClient) GetExternalMetric(metricName string, namespace string, selector labels.Selector) ([]int64, time.Time, error)
GetExternalMetric calls the fake MetricClient function
func (*MetricClient) GetObjectMetric ¶ added in v1.1.0
func (f *MetricClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error)
GetObjectMetric calls the fake MetricClient function
func (*MetricClient) GetRawMetric ¶ added in v1.1.0
func (f *MetricClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error)
GetRawMetric calls the fake MetricClient function
func (*MetricClient) GetResourceMetric ¶ added in v1.1.0
func (f *MetricClient) GetResourceMetric(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error)
GetResourceMetric calls the fake MetricClient function
type ObjectGatherer ¶ added in v1.1.0
type ObjectGatherer struct { GetMetricReactor func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, selector labels.Selector, metricSelector labels.Selector) (*object.Metric, error) GetPerPodMetricReactor func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (*object.Metric, error) }
ObjectGatherer (fake) provides a way to insert functionality into an ObjectGatherer
func (*ObjectGatherer) GetMetric ¶ added in v1.1.0
func (f *ObjectGatherer) GetMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, selector labels.Selector, metricSelector labels.Selector) (*object.Metric, error)
GetMetric calls the fake ObjectGatherer function
func (*ObjectGatherer) GetPerPodMetric ¶ added in v1.1.0
func (f *ObjectGatherer) GetPerPodMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (*object.Metric, error)
GetPerPodMetric calls the fake ObjectGatherer function
type PodLister ¶ added in v1.1.0
type PodLister struct { ListReactor func(selector labels.Selector) (ret []*corev1.Pod, err error) PodsReactor func(namespace string) corelisters.PodNamespaceLister }
PodLister (fake) provides a way to insert functionality into a PodLister
func (*PodLister) Pods ¶ added in v1.1.0
func (f *PodLister) Pods(namespace string) corelisters.PodNamespaceLister
Pods calls the fake PodLister function
type PodNamespaceLister ¶ added in v1.1.0
type PodNamespaceLister struct { ListReactor func(selector labels.Selector) (ret []*corev1.Pod, err error) GetReactor func(name string) (*corev1.Pod, error) }
PodNamespaceLister (fake) provides a way to insert functionality into a PodNamespaceLister
type PodReadyCounter ¶ added in v1.1.0
type PodReadyCounter struct {
GetReadyPodsCountReactor func(namespace string, selector labels.Selector) (int64, error)
}
PodReadyCounter (fake) provides a way to insert functionality into a PodReadyCounter
func (*PodReadyCounter) GetReadyPodsCount ¶ added in v1.1.0
func (f *PodReadyCounter) GetReadyPodsCount(namespace string, selector labels.Selector) (int64, error)
GetReadyPodsCount calls the fake PodReadyCounter function
type PodsGatherer ¶ added in v1.1.0
type PodsGatherer struct {
GetMetricReactor func(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (*pods.Metric, error)
}
PodsGatherer (fake) provides a way to insert functionality into an PodsGatherer
type ResourceClient ¶ added in v0.9.0
type ResourceClient struct {
GetReactor func(apiVersion string, kind string, name string, namespace string) (metav1.Object, error)
}
ResourceClient (fake) allows inserting logic into a resource client for testing
type ResourceGatherer ¶ added in v1.1.0
type ResourceGatherer struct { GetMetricReactor func(resource corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error) GetRawMetricReactor func(resource corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error) }
ResourceGatherer (fake) provides a way to insert functionality into an ResourceGatherer
func (*ResourceGatherer) GetMetric ¶ added in v1.1.0
func (f *ResourceGatherer) GetMetric(resource corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error)
GetMetric calls the fake ResourceGatherer function
func (*ResourceGatherer) GetRawMetric ¶ added in v1.1.0
func (f *ResourceGatherer) GetRawMetric(resource corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error)
GetRawMetric calls the fake ResourceGatherer function