Documentation ¶
Overview ¶
Package fake provides stubs for testing.
Index ¶
- type Calculate
- type MetricsClient
- func (f *MetricsClient) GetExternalMetric(metricName string, namespace string, selector labels.Selector) ([]int64, time.Time, error)
- func (f *MetricsClient) GetObjectMetric(metricName string, namespace string, ...) (int64, time.Time, error)
- func (f *MetricsClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, ...) (podmetrics.MetricsInfo, time.Time, error)
- func (f *MetricsClient) GetResourceMetric(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error)
- type PodLister
- type PodNamespaceLister
- type PodReadyCounter
- type ResourceClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Calculate ¶
type Calculate struct { GetUsageRatioReplicaCountReactor func(currentReplicas int32, usageRatio float64, readyPodCount int64) int32 GetPlainMetricReplicaCountReactor func(metrics podmetrics.MetricsInfo, currentReplicas int32, targetUtilization int64, readyPodCount int64, missingPods, ignoredPods sets.String) int32 }
Calculate (fake) provides a way to insert functionality into a Calculater
func (*Calculate) GetPlainMetricReplicaCount ¶
func (f *Calculate) GetPlainMetricReplicaCount(metrics podmetrics.MetricsInfo, currentReplicas int32, targetUtilization int64, readyPodCount int64, missingPods, ignoredPods sets.String) int32
GetPlainMetricReplicaCount calls the fake Calculater function
type MetricsClient ¶
type MetricsClient struct { GetResourceMetricReactor func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) GetRawMetricReactor func(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) GetObjectMetricReactor func(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) GetExternalMetricReactor func(metricName string, namespace string, selector labels.Selector) ([]int64, time.Time, error) }
MetricsClient (fake) provides a way to insert functionality into a metricsclient
func (*MetricsClient) GetExternalMetric ¶
func (f *MetricsClient) GetExternalMetric(metricName string, namespace string, selector labels.Selector) ([]int64, time.Time, error)
GetExternalMetric calls the fake metricsclient function
func (*MetricsClient) GetObjectMetric ¶
func (f *MetricsClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error)
GetObjectMetric calls the fake metricsclient function
func (*MetricsClient) GetRawMetric ¶
func (f *MetricsClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error)
GetRawMetric calls the fake metricsclient function
func (*MetricsClient) GetResourceMetric ¶
func (f *MetricsClient) GetResourceMetric(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error)
GetResourceMetric calls the fake metricsclient function
type PodLister ¶
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 ¶
func (f *PodLister) Pods(namespace string) corelisters.PodNamespaceLister
Pods calls the fake PodLister function
type PodNamespaceLister ¶
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 ¶
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 ¶
func (f *PodReadyCounter) GetReadyPodsCount(namespace string, selector labels.Selector) (int64, error)
GetReadyPodsCount calls the fake PodReadyCounter 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