Documentation ¶
Overview ¶
Package fake provides stubs for testing.
Index ¶
- type Calculate
- type ExternalEvaluater
- type ExternalGatherer
- 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 ObjectEvaluater
- type ObjectGatherer
- type PodLister
- type PodNamespaceLister
- type PodReadyCounter
- type PodsEvaluater
- type PodsGatherer
- type ResourceClient
- type ResourceEvaluater
- type ResourceGatherer
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 ExternalEvaluater ¶
type ExternalEvaluater struct { EvaluateReactor func(currentReplicas int32, gatheredMetric *metrics.Metric, tolerance float64) (int32, error) }
ExternalEvaluater (fake) provides a way to insert functionality into a ExternalEvaluater
type ExternalGatherer ¶
type ExternalGatherer struct { GatherReactor func(metricName, namespace string, metricSelector *metav1.LabelSelector, podSelector labels.Selector) (*externalmetrics.Metric, error) GatherPerPodReactor func(metricName, namespace string, metricSelector *metav1.LabelSelector) (*externalmetrics.Metric, error) }
ExternalGatherer (fake) provides a way to insert functionality into a ExternalGatherer
func (*ExternalGatherer) Gather ¶
func (f *ExternalGatherer) Gather(metricName, namespace string, metricSelector *metav1.LabelSelector, podSelector labels.Selector) (*externalmetrics.Metric, error)
Gather calls the fake ExternalGatherer function
func (*ExternalGatherer) GatherPerPod ¶
func (f *ExternalGatherer) GatherPerPod(metricName, namespace string, metricSelector *metav1.LabelSelector) (*externalmetrics.Metric, error)
GatherPerPod calls the fake ExternalGatherer 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 ObjectEvaluater ¶
type ObjectEvaluater struct {
EvaluateReactor func(currentReplicas int32, gatheredMetric *metrics.Metric, tolerance float64) (int32, error)
}
ObjectEvaluater (fake) provides a way to insert functionality into a ObjectEvaluater
type ObjectGatherer ¶
type ObjectGatherer struct { GatherReactor func(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, podSelector labels.Selector, metricSelector labels.Selector) (*objectmetrics.Metric, error) GatherPerPodReactor func(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (*objectmetrics.Metric, error) }
ObjectGatherer (fake) provides a way to insert functionality into a ObjectGatherer
func (*ObjectGatherer) Gather ¶
func (f *ObjectGatherer) Gather(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, podSelector labels.Selector, metricSelector labels.Selector) (*objectmetrics.Metric, error)
Gather calls the fake ObjectGatherer function
func (*ObjectGatherer) GatherPerPod ¶
func (f *ObjectGatherer) GatherPerPod(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (*objectmetrics.Metric, error)
GatherPerPod calls the fake ObjectGatherer 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 PodsEvaluater ¶
type PodsEvaluater struct {
EvaluateReactor func(currentReplicas int32, gatheredMetric *metrics.Metric) int32
}
PodsEvaluater (fake) provides a way to insert functionality into a PodsEvaluater
type PodsGatherer ¶
type PodsGatherer struct { GatherReactor func(metricName string, namespace string, podSelector labels.Selector, metricSelector labels.Selector) (*podsmetrics.Metric, error) }
PodsGatherer (fake) provides a way to insert functionality into a PodsGatherer
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 ResourceEvaluater ¶
type ResourceEvaluater struct {
EvaluateReactor func(currentReplicas int32, gatheredMetric *metrics.Metric, tolerance float64) (int32, error)
}
ResourceEvaluater (fake) provides a way to insert functionality into a ResourceEvaluater
type ResourceGatherer ¶
type ResourceGatherer struct { GatherReactor func(resourceName corev1.ResourceName, namespace string, podSelector labels.Selector, cpuInitializationPeriod time.Duration, delayOfInitialReadinessStatus time.Duration) (*resourcemetrics.Metric, error) GatherRawReactor func(resourceName corev1.ResourceName, namespace string, podSelector labels.Selector, cpuInitializationPeriod time.Duration, delayOfInitialReadinessStatus time.Duration) (*resourcemetrics.Metric, error) }
ResourceGatherer (fake) provides a way to insert functionality into a ResourceGatherer
func (*ResourceGatherer) Gather ¶
func (f *ResourceGatherer) Gather(resourceName corev1.ResourceName, namespace string, podSelector labels.Selector, cpuInitializationPeriod time.Duration, delayOfInitialReadinessStatus time.Duration) (*resourcemetrics.Metric, error)
Gather calls the fake ResourceGatherer function
func (*ResourceGatherer) GatherRaw ¶
func (f *ResourceGatherer) GatherRaw(resourceName corev1.ResourceName, namespace string, podSelector labels.Selector, cpuInitializationPeriod time.Duration, delayOfInitialReadinessStatus time.Duration) (*resourcemetrics.Metric, error)
GatherRaw calls the fake ResourceGatherer function