mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
Fresh dep ensure
This commit is contained in:
9
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/BUILD
generated
vendored
9
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/BUILD
generated
vendored
@ -17,10 +17,10 @@ go_library(
|
||||
importpath = "k8s.io/kubernetes/pkg/apis/autoscaling",
|
||||
deps = [
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@ -39,6 +39,7 @@ filegroup(
|
||||
"//pkg/apis/autoscaling/install:all-srcs",
|
||||
"//pkg/apis/autoscaling/v1:all-srcs",
|
||||
"//pkg/apis/autoscaling/v2beta1:all-srcs",
|
||||
"//pkg/apis/autoscaling/v2beta2:all-srcs",
|
||||
"//pkg/apis/autoscaling/validation:all-srcs",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
|
6
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/fuzzer/BUILD
generated
vendored
6
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/fuzzer/BUILD
generated
vendored
@ -12,10 +12,10 @@ go_library(
|
||||
deps = [
|
||||
"//pkg/apis/autoscaling:go_default_library",
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
|
||||
"//vendor/github.com/google/gofuzz:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
42
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/fuzzer/fuzzer.go
generated
vendored
42
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/fuzzer/fuzzer.go
generated
vendored
@ -51,20 +51,42 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
|
||||
return q
|
||||
}
|
||||
|
||||
var podMetricID autoscaling.MetricIdentifier
|
||||
var objMetricID autoscaling.MetricIdentifier
|
||||
c.Fuzz(&podMetricID)
|
||||
c.Fuzz(&objMetricID)
|
||||
|
||||
targetUtilization := int32(c.RandUint64())
|
||||
averageValue := randomQuantity()
|
||||
s.Metrics = []autoscaling.MetricSpec{
|
||||
{
|
||||
Type: autoscaling.PodsMetricSourceType,
|
||||
Pods: &autoscaling.PodsMetricSource{
|
||||
MetricName: c.RandString(),
|
||||
TargetAverageValue: randomQuantity(),
|
||||
Metric: podMetricID,
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.AverageValueMetricType,
|
||||
AverageValue: &averageValue,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: autoscaling.ObjectMetricSourceType,
|
||||
Object: &autoscaling.ObjectMetricSource{
|
||||
Metric: objMetricID,
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: &averageValue,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageUtilization: &targetUtilization,
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
AverageUtilization: &targetUtilization,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -78,20 +100,28 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
|
||||
_ = q.String()
|
||||
return q
|
||||
}
|
||||
averageValue := randomQuantity()
|
||||
currentUtilization := int32(c.RandUint64())
|
||||
s.CurrentMetrics = []autoscaling.MetricStatus{
|
||||
{
|
||||
Type: autoscaling.PodsMetricSourceType,
|
||||
Pods: &autoscaling.PodsMetricStatus{
|
||||
MetricName: c.RandString(),
|
||||
CurrentAverageValue: randomQuantity(),
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: c.RandString(),
|
||||
},
|
||||
Current: autoscaling.MetricValueStatus{
|
||||
AverageValue: &averageValue,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricStatus{
|
||||
Name: api.ResourceCPU,
|
||||
CurrentAverageUtilization: ¤tUtilization,
|
||||
Current: autoscaling.MetricValueStatus{
|
||||
AverageUtilization: ¤tUtilization,
|
||||
AverageValue: &averageValue,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
14
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/install/BUILD
generated
vendored
14
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/install/BUILD
generated
vendored
@ -1,21 +1,18 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["install.go"],
|
||||
importpath = "k8s.io/kubernetes/pkg/apis/autoscaling/install",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//pkg/api/legacyscheme:go_default_library",
|
||||
"//pkg/apis/autoscaling:go_default_library",
|
||||
"//pkg/apis/autoscaling/v1:go_default_library",
|
||||
"//pkg/apis/autoscaling/v2beta1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
|
||||
"//pkg/apis/autoscaling/v2beta2:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@ -30,4 +27,5 @@ filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
4
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/install/install.go
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/install/install.go
generated
vendored
@ -25,6 +25,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1"
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -34,7 +35,8 @@ func init() {
|
||||
// Install registers the API group and adds types to a scheme
|
||||
func Install(scheme *runtime.Scheme) {
|
||||
utilruntime.Must(autoscaling.AddToScheme(scheme))
|
||||
utilruntime.Must(v2beta2.AddToScheme(scheme))
|
||||
utilruntime.Must(v2beta1.AddToScheme(scheme))
|
||||
utilruntime.Must(v1.AddToScheme(scheme))
|
||||
utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion, v2beta1.SchemeGroupVersion))
|
||||
utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion, v2beta1.SchemeGroupVersion, v2beta2.SchemeGroupVersion))
|
||||
}
|
||||
|
138
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go
generated
vendored
138
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go
generated
vendored
@ -154,13 +154,9 @@ type MetricSpec struct {
|
||||
// ObjectMetricSource indicates how to scale on a metric describing a
|
||||
// kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
type ObjectMetricSource struct {
|
||||
// Target is the described Kubernetes object.
|
||||
Target CrossVersionObjectReference
|
||||
|
||||
// MetricName is the name of the metric in question.
|
||||
MetricName string
|
||||
// TargetValue is the target value of the metric (as a quantity).
|
||||
TargetValue resource.Quantity
|
||||
DescribedObject CrossVersionObjectReference
|
||||
Target MetricTarget
|
||||
Metric MetricIdentifier
|
||||
}
|
||||
|
||||
// PodsMetricSource indicates how to scale on a metric describing each pod in
|
||||
@ -168,11 +164,10 @@ type ObjectMetricSource struct {
|
||||
// The values will be averaged together before being compared to the target
|
||||
// value.
|
||||
type PodsMetricSource struct {
|
||||
// MetricName is the name of the metric in question
|
||||
MetricName string
|
||||
// TargetAverageValue is the target value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
TargetAverageValue resource.Quantity
|
||||
// metric identifies the target metric by name and selector
|
||||
Metric MetricIdentifier
|
||||
// target specifies the target value for the given metric
|
||||
Target MetricTarget
|
||||
}
|
||||
|
||||
// ResourceMetricSource indicates how to scale on a resource metric known to
|
||||
@ -185,38 +180,57 @@ type PodsMetricSource struct {
|
||||
type ResourceMetricSource struct {
|
||||
// Name is the name of the resource in question.
|
||||
Name api.ResourceName
|
||||
// TargetAverageUtilization is the target value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods.
|
||||
// +optional
|
||||
TargetAverageUtilization *int32
|
||||
// TargetAverageValue is the target value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// +optional
|
||||
TargetAverageValue *resource.Quantity
|
||||
// Target specifies the target value for the given metric
|
||||
Target MetricTarget
|
||||
}
|
||||
|
||||
// ExternalMetricSource indicates how to scale on a metric not associated with
|
||||
// any Kubernetes object (for example length of queue in cloud
|
||||
// messaging service, or QPS from loadbalancer running outside of cluster).
|
||||
type ExternalMetricSource struct {
|
||||
// metricName is the name of the metric in question.
|
||||
MetricName string
|
||||
// MetricSelector is used to identify a specific time series
|
||||
// within a given metric.
|
||||
// +optional
|
||||
MetricSelector *metav1.LabelSelector
|
||||
// TargetValue is the target value of the metric (as a quantity).
|
||||
// Mutually exclusive with TargetAverageValue.
|
||||
// +optional
|
||||
TargetValue *resource.Quantity
|
||||
// TargetAverageValue is the target per-pod value of global metric (as a quantity).
|
||||
// Mutually exclusive with TargetValue.
|
||||
// +optional
|
||||
TargetAverageValue *resource.Quantity
|
||||
// Metric identifies the target metric by name and selector
|
||||
Metric MetricIdentifier
|
||||
// Target specifies the target value for the given metric
|
||||
Target MetricTarget
|
||||
}
|
||||
|
||||
// MetricIdentifier defines the name and optionally selector for a metric
|
||||
type MetricIdentifier struct {
|
||||
// Name is the name of the given metric
|
||||
Name string
|
||||
// Selector is the selector for the given metric
|
||||
// it is the string-encoded form of a standard kubernetes label selector
|
||||
// +optional
|
||||
Selector *metav1.LabelSelector
|
||||
}
|
||||
|
||||
// MetricTarget defines the target value, average value, or average utilization of a specific metric
|
||||
type MetricTarget struct {
|
||||
// Type represents whether the metric type is Utilization, Value, or AverageValue
|
||||
Type MetricTargetType
|
||||
// Value is the target value of the metric (as a quantity).
|
||||
Value *resource.Quantity
|
||||
// TargetAverageValue is the target value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
AverageValue *resource.Quantity
|
||||
|
||||
// AverageUtilization is the target value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods.
|
||||
// Currently only valid for Resource metric source type
|
||||
AverageUtilization *int32
|
||||
}
|
||||
|
||||
// MetricTargetType specifies the type of metric being targeted, and should be either
|
||||
// "Value", "AverageValue", or "Utilization"
|
||||
type MetricTargetType string
|
||||
|
||||
var (
|
||||
UtilizationMetricType MetricTargetType = "Utilization"
|
||||
ValueMetricType MetricTargetType = "Value"
|
||||
AverageValueMetricType MetricTargetType = "AverageValue"
|
||||
)
|
||||
|
||||
// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
|
||||
type HorizontalPodAutoscalerStatus struct {
|
||||
// ObservedGeneration is the most recent generation observed by this autoscaler.
|
||||
@ -237,6 +251,7 @@ type HorizontalPodAutoscalerStatus struct {
|
||||
DesiredReplicas int32
|
||||
|
||||
// CurrentMetrics is the last read state of the metrics used by this autoscaler.
|
||||
// +optional
|
||||
CurrentMetrics []MetricStatus
|
||||
|
||||
// Conditions is the set of conditions required for this autoscaler to scale its target,
|
||||
@ -327,23 +342,17 @@ type MetricStatus struct {
|
||||
// ObjectMetricStatus indicates the current value of a metric describing a
|
||||
// kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
type ObjectMetricStatus struct {
|
||||
// Target is the described Kubernetes object.
|
||||
Target CrossVersionObjectReference
|
||||
Metric MetricIdentifier
|
||||
Current MetricValueStatus
|
||||
|
||||
// MetricName is the name of the metric in question.
|
||||
MetricName string
|
||||
// CurrentValue is the current value of the metric (as a quantity).
|
||||
CurrentValue resource.Quantity
|
||||
DescribedObject CrossVersionObjectReference
|
||||
}
|
||||
|
||||
// PodsMetricStatus indicates the current value of a metric describing each pod in
|
||||
// the current scale target (for example, transactions-processed-per-second).
|
||||
type PodsMetricStatus struct {
|
||||
// MetricName is the name of the metric in question
|
||||
MetricName string
|
||||
// CurrentAverageValue is the current value of the average of the
|
||||
// metric across all relevant pods (as a quantity)
|
||||
CurrentAverageValue resource.Quantity
|
||||
Metric MetricIdentifier
|
||||
Current MetricValueStatus
|
||||
}
|
||||
|
||||
// ResourceMetricStatus indicates the current value of a resource metric known to
|
||||
@ -353,36 +362,21 @@ type PodsMetricStatus struct {
|
||||
// normal per-pod metrics using the "pods" source.
|
||||
type ResourceMetricStatus struct {
|
||||
// Name is the name of the resource in question.
|
||||
Name api.ResourceName
|
||||
// CurrentAverageUtilization is the current value of the average of the
|
||||
// resource metric across all relevant pods, represented as a percentage of
|
||||
// the requested value of the resource for the pods. It will only be
|
||||
// present if `targetAverageValue` was set in the corresponding metric
|
||||
// specification.
|
||||
// +optional
|
||||
CurrentAverageUtilization *int32
|
||||
// CurrentAverageValue is the current value of the average of the
|
||||
// resource metric across all relevant pods, as a raw value (instead of as
|
||||
// a percentage of the request), similar to the "pods" metric source type.
|
||||
// It will always be set, regardless of the corresponding metric specification.
|
||||
CurrentAverageValue resource.Quantity
|
||||
Name api.ResourceName
|
||||
Current MetricValueStatus
|
||||
}
|
||||
|
||||
// ExternalMetricStatus indicates the current value of a global metric
|
||||
// not associated with any Kubernetes object.
|
||||
type ExternalMetricStatus struct {
|
||||
// MetricName is the name of a metric used for autoscaling in
|
||||
// metric system.
|
||||
MetricName string
|
||||
// MetricSelector is used to identify a specific time series
|
||||
// within a given metric.
|
||||
// +optional
|
||||
MetricSelector *metav1.LabelSelector
|
||||
// CurrentValue is the current value of the metric (as a quantity)
|
||||
CurrentValue resource.Quantity
|
||||
// CurrentAverageValue is the current value of metric averaged over autoscaled pods.
|
||||
// +optional
|
||||
CurrentAverageValue *resource.Quantity
|
||||
Metric MetricIdentifier
|
||||
Current MetricValueStatus
|
||||
}
|
||||
|
||||
type MetricValueStatus struct {
|
||||
Value *resource.Quantity
|
||||
AverageValue *resource.Quantity
|
||||
AverageUtilization *int32
|
||||
}
|
||||
|
||||
// +genclient
|
||||
|
33
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/BUILD
generated
vendored
33
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/BUILD
generated
vendored
@ -1,10 +1,4 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
"go_test",
|
||||
)
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
@ -17,30 +11,30 @@ go_library(
|
||||
"zz_generated.defaults.go",
|
||||
],
|
||||
importpath = "k8s.io/kubernetes/pkg/apis/autoscaling/v1",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//pkg/apis/autoscaling:go_default_library",
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//vendor/k8s.io/api/autoscaling/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_xtest",
|
||||
name = "go_default_test",
|
||||
srcs = ["defaults_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
":go_default_library",
|
||||
"//pkg/api/legacyscheme:go_default_library",
|
||||
"//pkg/apis/autoscaling/install:go_default_library",
|
||||
"//pkg/apis/core/install:go_default_library",
|
||||
"//pkg/util/pointer:go_default_library",
|
||||
"//vendor/k8s.io/api/autoscaling/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//staging/src/k8s.io/api/autoscaling/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/utils/pointer:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@ -55,4 +49,5 @@ filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
275
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/conversion.go
generated
vendored
275
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/conversion.go
generated
vendored
@ -21,10 +21,12 @@ import (
|
||||
|
||||
autoscalingv1 "k8s.io/api/autoscaling/v1"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
api "k8s.io/kubernetes/pkg/apis/core"
|
||||
core "k8s.io/kubernetes/pkg/apis/core"
|
||||
)
|
||||
|
||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
@ -36,6 +38,22 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec,
|
||||
Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus,
|
||||
Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus,
|
||||
Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource,
|
||||
Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource,
|
||||
Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource,
|
||||
Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource,
|
||||
Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource,
|
||||
Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource,
|
||||
Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus,
|
||||
Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus,
|
||||
Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus,
|
||||
Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus,
|
||||
Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus,
|
||||
Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus,
|
||||
Convert_autoscaling_MetricTarget_To_v1_CrossVersionObjectReference,
|
||||
Convert_v1_CrossVersionObjectReference_To_autoscaling_MetricTarget,
|
||||
Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus,
|
||||
Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -44,6 +62,235 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_MetricTarget_To_v1_CrossVersionObjectReference(in *autoscaling.MetricTarget, out *autoscalingv1.CrossVersionObjectReference, s conversion.Scope) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_CrossVersionObjectReference_To_autoscaling_MetricTarget(in *autoscalingv1.CrossVersionObjectReference, out *autoscaling.MetricTarget, s conversion.Scope) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *autoscalingv1.ExternalMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.Metric.Name
|
||||
out.TargetValue = in.Target.Value
|
||||
out.TargetAverageValue = in.Target.AverageValue
|
||||
out.MetricSelector = in.Metric.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *autoscalingv1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
|
||||
value := in.TargetValue
|
||||
averageValue := in.TargetAverageValue
|
||||
var metricType autoscaling.MetricTargetType
|
||||
if value == nil {
|
||||
metricType = autoscaling.AverageValueMetricType
|
||||
} else {
|
||||
metricType = autoscaling.ValueMetricType
|
||||
}
|
||||
out.Target = autoscaling.MetricTarget{
|
||||
Type: metricType,
|
||||
Value: value,
|
||||
AverageValue: averageValue,
|
||||
}
|
||||
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.MetricSelector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *autoscalingv1.ObjectMetricSource, s conversion.Scope) error {
|
||||
if in.Target.Value != nil {
|
||||
out.TargetValue = *in.Target.Value
|
||||
}
|
||||
out.AverageValue = in.Target.AverageValue
|
||||
out.Target = autoscalingv1.CrossVersionObjectReference{
|
||||
Kind: in.DescribedObject.Kind,
|
||||
Name: in.DescribedObject.Name,
|
||||
APIVersion: in.DescribedObject.APIVersion,
|
||||
}
|
||||
out.MetricName = in.Metric.Name
|
||||
out.Selector = in.Metric.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *autoscalingv1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
|
||||
var metricType autoscaling.MetricTargetType
|
||||
if in.AverageValue == nil {
|
||||
metricType = autoscaling.ValueMetricType
|
||||
} else {
|
||||
metricType = autoscaling.AverageValueMetricType
|
||||
}
|
||||
|
||||
out.Target = autoscaling.MetricTarget{
|
||||
Type: metricType,
|
||||
Value: &in.TargetValue,
|
||||
AverageValue: in.AverageValue,
|
||||
}
|
||||
out.DescribedObject = autoscaling.CrossVersionObjectReference{
|
||||
Kind: in.Target.Kind,
|
||||
Name: in.Target.Name,
|
||||
APIVersion: in.Target.APIVersion,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.Selector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *autoscalingv1.PodsMetricSource, s conversion.Scope) error {
|
||||
if in.Target.AverageValue != nil {
|
||||
out.TargetAverageValue = *in.Target.AverageValue
|
||||
}
|
||||
|
||||
out.MetricName = in.Metric.Name
|
||||
out.Selector = in.Metric.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *autoscalingv1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
|
||||
var metricType autoscaling.MetricTargetType
|
||||
metricType = autoscaling.AverageValueMetricType
|
||||
|
||||
out.Target = autoscaling.MetricTarget{
|
||||
Type: metricType,
|
||||
AverageValue: &in.TargetAverageValue,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.Selector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *autoscalingv1.ExternalMetricStatus, s conversion.Scope) error {
|
||||
out.MetricName = in.Metric.Name
|
||||
if in.Current.Value != nil {
|
||||
out.CurrentValue = *in.Current.Value
|
||||
}
|
||||
if in.Current.AverageValue != nil {
|
||||
out.CurrentAverageValue = in.Current.AverageValue
|
||||
}
|
||||
out.MetricSelector = in.Metric.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *autoscalingv1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
|
||||
value := in.CurrentValue
|
||||
averageValue := in.CurrentAverageValue
|
||||
out.Current = autoscaling.MetricValueStatus{
|
||||
Value: &value,
|
||||
AverageValue: averageValue,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.MetricSelector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *autoscalingv1.ObjectMetricStatus, s conversion.Scope) error {
|
||||
if in.Current.Value != nil {
|
||||
out.CurrentValue = *in.Current.Value
|
||||
}
|
||||
if in.Current.AverageValue != nil {
|
||||
currentAverageValue := *in.Current.AverageValue
|
||||
out.AverageValue = ¤tAverageValue
|
||||
}
|
||||
out.Target = autoscalingv1.CrossVersionObjectReference{
|
||||
Kind: in.DescribedObject.Kind,
|
||||
Name: in.DescribedObject.Name,
|
||||
APIVersion: in.DescribedObject.APIVersion,
|
||||
}
|
||||
out.MetricName = in.Metric.Name
|
||||
out.Selector = in.Metric.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *autoscalingv1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
|
||||
out.Current = autoscaling.MetricValueStatus{
|
||||
Value: &in.CurrentValue,
|
||||
AverageValue: in.AverageValue,
|
||||
}
|
||||
out.DescribedObject = autoscaling.CrossVersionObjectReference{
|
||||
Kind: in.Target.Kind,
|
||||
Name: in.Target.Name,
|
||||
APIVersion: in.Target.APIVersion,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.Selector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *autoscalingv1.PodsMetricStatus, s conversion.Scope) error {
|
||||
if in.Current.AverageValue != nil {
|
||||
out.CurrentAverageValue = *in.Current.AverageValue
|
||||
}
|
||||
out.MetricName = in.Metric.Name
|
||||
out.Selector = in.Metric.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *autoscalingv1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
|
||||
out.Current = autoscaling.MetricValueStatus{
|
||||
AverageValue: &in.CurrentAverageValue,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.Selector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *autoscalingv1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
|
||||
out.Name = core.ResourceName(in.Name)
|
||||
utilization := in.TargetAverageUtilization
|
||||
averageValue := in.TargetAverageValue
|
||||
var metricType autoscaling.MetricTargetType
|
||||
if utilization == nil {
|
||||
metricType = autoscaling.AverageValueMetricType
|
||||
} else {
|
||||
metricType = autoscaling.UtilizationMetricType
|
||||
}
|
||||
out.Target = autoscaling.MetricTarget{
|
||||
Type: metricType,
|
||||
AverageValue: averageValue,
|
||||
AverageUtilization: utilization,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *autoscalingv1.ResourceMetricSource, s conversion.Scope) error {
|
||||
out.Name = v1.ResourceName(in.Name)
|
||||
out.TargetAverageUtilization = in.Target.AverageUtilization
|
||||
out.TargetAverageValue = in.Target.AverageValue
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *autoscalingv1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
|
||||
out.Name = core.ResourceName(in.Name)
|
||||
utilization := in.CurrentAverageUtilization
|
||||
averageValue := &in.CurrentAverageValue
|
||||
out.Current = autoscaling.MetricValueStatus{
|
||||
AverageValue: averageValue,
|
||||
AverageUtilization: utilization,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *autoscalingv1.ResourceMetricStatus, s conversion.Scope) error {
|
||||
out.Name = v1.ResourceName(in.Name)
|
||||
out.CurrentAverageUtilization = in.Current.AverageUtilization
|
||||
if in.Current.AverageValue != nil {
|
||||
out.CurrentAverageValue = *in.Current.AverageValue
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in *autoscaling.HorizontalPodAutoscaler, out *autoscalingv1.HorizontalPodAutoscaler, s conversion.Scope) error {
|
||||
if err := autoConvert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in, out, s); err != nil {
|
||||
return err
|
||||
@ -51,7 +298,7 @@ func Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(i
|
||||
|
||||
otherMetrics := make([]autoscalingv1.MetricSpec, 0, len(in.Spec.Metrics))
|
||||
for _, metric := range in.Spec.Metrics {
|
||||
if metric.Type == autoscaling.ResourceMetricSourceType && metric.Resource != nil && metric.Resource.Name == api.ResourceCPU && metric.Resource.TargetAverageUtilization != nil {
|
||||
if metric.Type == autoscaling.ResourceMetricSourceType && metric.Resource != nil && metric.Resource.Name == api.ResourceCPU && metric.Resource.Target.AverageUtilization != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
@ -165,11 +412,14 @@ func Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(i
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
out.Spec.Metrics[0].Resource.TargetAverageUtilization = new(int32)
|
||||
*out.Spec.Metrics[0].Resource.TargetAverageUtilization = autoscaling.DefaultCPUUtilization
|
||||
out.Spec.Metrics[0].Resource.Target.AverageUtilization = new(int32)
|
||||
*out.Spec.Metrics[0].Resource.Target.AverageUtilization = autoscaling.DefaultCPUUtilization
|
||||
}
|
||||
|
||||
if currentConditionsEnc, hasCurrentConditions := out.Annotations[autoscaling.HorizontalPodAutoscalerConditionsAnnotation]; hasCurrentConditions {
|
||||
@ -200,9 +450,9 @@ func Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscal
|
||||
|
||||
for _, metric := range in.Metrics {
|
||||
if metric.Type == autoscaling.ResourceMetricSourceType && metric.Resource != nil && metric.Resource.Name == api.ResourceCPU {
|
||||
if metric.Resource.TargetAverageUtilization != nil {
|
||||
if metric.Resource.Target.AverageUtilization != nil {
|
||||
out.TargetCPUUtilizationPercentage = new(int32)
|
||||
*out.TargetCPUUtilizationPercentage = *metric.Resource.TargetAverageUtilization
|
||||
*out.TargetCPUUtilizationPercentage = *metric.Resource.Target.AverageUtilization
|
||||
}
|
||||
break
|
||||
}
|
||||
@ -225,11 +475,14 @@ func Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscal
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
out.Metrics[0].Resource.TargetAverageUtilization = new(int32)
|
||||
*out.Metrics[0].Resource.TargetAverageUtilization = *in.TargetCPUUtilizationPercentage
|
||||
out.Metrics[0].Resource.Target.AverageUtilization = new(int32)
|
||||
*out.Metrics[0].Resource.Target.AverageUtilization = *in.TargetCPUUtilizationPercentage
|
||||
}
|
||||
|
||||
return nil
|
||||
@ -244,10 +497,10 @@ func Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutosc
|
||||
|
||||
for _, metric := range in.CurrentMetrics {
|
||||
if metric.Type == autoscaling.ResourceMetricSourceType && metric.Resource != nil && metric.Resource.Name == api.ResourceCPU {
|
||||
if metric.Resource.CurrentAverageUtilization != nil {
|
||||
if metric.Resource.Current.AverageUtilization != nil {
|
||||
|
||||
out.CurrentCPUUtilizationPercentage = new(int32)
|
||||
*out.CurrentCPUUtilizationPercentage = *metric.Resource.CurrentAverageUtilization
|
||||
*out.CurrentCPUUtilizationPercentage = *metric.Resource.Current.AverageUtilization
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -270,8 +523,8 @@ func Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutosc
|
||||
},
|
||||
},
|
||||
}
|
||||
out.CurrentMetrics[0].Resource.CurrentAverageUtilization = new(int32)
|
||||
*out.CurrentMetrics[0].Resource.CurrentAverageUtilization = *in.CurrentCPUUtilizationPercentage
|
||||
out.CurrentMetrics[0].Resource.Current.AverageUtilization = new(int32)
|
||||
*out.CurrentMetrics[0].Resource.Current.AverageUtilization = *in.CurrentCPUUtilizationPercentage
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
2
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/defaults_test.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/defaults_test.go
generated
vendored
@ -27,7 +27,7 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
|
||||
. "k8s.io/kubernetes/pkg/apis/autoscaling/v1"
|
||||
_ "k8s.io/kubernetes/pkg/apis/core/install"
|
||||
utilpointer "k8s.io/kubernetes/pkg/util/pointer"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
func TestSetDefaultHPA(t *testing.T) {
|
||||
|
700
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/zz_generated.conversion.go
generated
vendored
700
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v1/zz_generated.conversion.go
generated
vendored
@ -24,9 +24,8 @@ import (
|
||||
unsafe "unsafe"
|
||||
|
||||
v1 "k8s.io/api/autoscaling/v1"
|
||||
core_v1 "k8s.io/api/core/v1"
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
@ -39,47 +38,318 @@ func init() {
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedConversionFuncs(
|
||||
Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference,
|
||||
Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference,
|
||||
Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource,
|
||||
Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource,
|
||||
Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus,
|
||||
Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus,
|
||||
Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler,
|
||||
Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler,
|
||||
Convert_v1_HorizontalPodAutoscalerCondition_To_autoscaling_HorizontalPodAutoscalerCondition,
|
||||
Convert_autoscaling_HorizontalPodAutoscalerCondition_To_v1_HorizontalPodAutoscalerCondition,
|
||||
Convert_v1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList,
|
||||
Convert_autoscaling_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList,
|
||||
Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec,
|
||||
Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec,
|
||||
Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus,
|
||||
Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus,
|
||||
Convert_v1_MetricSpec_To_autoscaling_MetricSpec,
|
||||
Convert_autoscaling_MetricSpec_To_v1_MetricSpec,
|
||||
Convert_v1_MetricStatus_To_autoscaling_MetricStatus,
|
||||
Convert_autoscaling_MetricStatus_To_v1_MetricStatus,
|
||||
Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource,
|
||||
Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource,
|
||||
Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus,
|
||||
Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus,
|
||||
Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource,
|
||||
Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource,
|
||||
Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus,
|
||||
Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus,
|
||||
Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource,
|
||||
Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource,
|
||||
Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus,
|
||||
Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus,
|
||||
Convert_v1_Scale_To_autoscaling_Scale,
|
||||
Convert_autoscaling_Scale_To_v1_Scale,
|
||||
Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec,
|
||||
Convert_autoscaling_ScaleSpec_To_v1_ScaleSpec,
|
||||
Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus,
|
||||
Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus,
|
||||
)
|
||||
func RegisterConversions(s *runtime.Scheme) error {
|
||||
if err := s.AddGeneratedConversionFunc((*v1.CrossVersionObjectReference)(nil), (*autoscaling.CrossVersionObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(a.(*v1.CrossVersionObjectReference), b.(*autoscaling.CrossVersionObjectReference), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.CrossVersionObjectReference)(nil), (*v1.CrossVersionObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(a.(*autoscaling.CrossVersionObjectReference), b.(*v1.CrossVersionObjectReference), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ExternalMetricSource)(nil), (*autoscaling.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(a.(*v1.ExternalMetricSource), b.(*autoscaling.ExternalMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ExternalMetricSource)(nil), (*v1.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(a.(*autoscaling.ExternalMetricSource), b.(*v1.ExternalMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ExternalMetricStatus)(nil), (*autoscaling.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(a.(*v1.ExternalMetricStatus), b.(*autoscaling.ExternalMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ExternalMetricStatus)(nil), (*v1.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(a.(*autoscaling.ExternalMetricStatus), b.(*v1.ExternalMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.HorizontalPodAutoscaler)(nil), (*autoscaling.HorizontalPodAutoscaler)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(a.(*v1.HorizontalPodAutoscaler), b.(*autoscaling.HorizontalPodAutoscaler), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscaler)(nil), (*v1.HorizontalPodAutoscaler)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(a.(*autoscaling.HorizontalPodAutoscaler), b.(*v1.HorizontalPodAutoscaler), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.HorizontalPodAutoscalerCondition)(nil), (*autoscaling.HorizontalPodAutoscalerCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_HorizontalPodAutoscalerCondition_To_autoscaling_HorizontalPodAutoscalerCondition(a.(*v1.HorizontalPodAutoscalerCondition), b.(*autoscaling.HorizontalPodAutoscalerCondition), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscalerCondition)(nil), (*v1.HorizontalPodAutoscalerCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerCondition_To_v1_HorizontalPodAutoscalerCondition(a.(*autoscaling.HorizontalPodAutoscalerCondition), b.(*v1.HorizontalPodAutoscalerCondition), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.HorizontalPodAutoscalerList)(nil), (*autoscaling.HorizontalPodAutoscalerList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(a.(*v1.HorizontalPodAutoscalerList), b.(*autoscaling.HorizontalPodAutoscalerList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscalerList)(nil), (*v1.HorizontalPodAutoscalerList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList(a.(*autoscaling.HorizontalPodAutoscalerList), b.(*v1.HorizontalPodAutoscalerList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.HorizontalPodAutoscalerSpec)(nil), (*autoscaling.HorizontalPodAutoscalerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(a.(*v1.HorizontalPodAutoscalerSpec), b.(*autoscaling.HorizontalPodAutoscalerSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscalerSpec)(nil), (*v1.HorizontalPodAutoscalerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(a.(*autoscaling.HorizontalPodAutoscalerSpec), b.(*v1.HorizontalPodAutoscalerSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.HorizontalPodAutoscalerStatus)(nil), (*autoscaling.HorizontalPodAutoscalerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(a.(*v1.HorizontalPodAutoscalerStatus), b.(*autoscaling.HorizontalPodAutoscalerStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscalerStatus)(nil), (*v1.HorizontalPodAutoscalerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(a.(*autoscaling.HorizontalPodAutoscalerStatus), b.(*v1.HorizontalPodAutoscalerStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.MetricSpec)(nil), (*autoscaling.MetricSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_MetricSpec_To_autoscaling_MetricSpec(a.(*v1.MetricSpec), b.(*autoscaling.MetricSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.MetricSpec)(nil), (*v1.MetricSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_MetricSpec_To_v1_MetricSpec(a.(*autoscaling.MetricSpec), b.(*v1.MetricSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.MetricStatus)(nil), (*autoscaling.MetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_MetricStatus_To_autoscaling_MetricStatus(a.(*v1.MetricStatus), b.(*autoscaling.MetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.MetricStatus)(nil), (*v1.MetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_MetricStatus_To_v1_MetricStatus(a.(*autoscaling.MetricStatus), b.(*v1.MetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ObjectMetricSource)(nil), (*autoscaling.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(a.(*v1.ObjectMetricSource), b.(*autoscaling.ObjectMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ObjectMetricSource)(nil), (*v1.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(a.(*autoscaling.ObjectMetricSource), b.(*v1.ObjectMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ObjectMetricStatus)(nil), (*autoscaling.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(a.(*v1.ObjectMetricStatus), b.(*autoscaling.ObjectMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ObjectMetricStatus)(nil), (*v1.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(a.(*autoscaling.ObjectMetricStatus), b.(*v1.ObjectMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.PodsMetricSource)(nil), (*autoscaling.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(a.(*v1.PodsMetricSource), b.(*autoscaling.PodsMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.PodsMetricSource)(nil), (*v1.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(a.(*autoscaling.PodsMetricSource), b.(*v1.PodsMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.PodsMetricStatus)(nil), (*autoscaling.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(a.(*v1.PodsMetricStatus), b.(*autoscaling.PodsMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.PodsMetricStatus)(nil), (*v1.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(a.(*autoscaling.PodsMetricStatus), b.(*v1.PodsMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ResourceMetricSource)(nil), (*autoscaling.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(a.(*v1.ResourceMetricSource), b.(*autoscaling.ResourceMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ResourceMetricSource)(nil), (*v1.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(a.(*autoscaling.ResourceMetricSource), b.(*v1.ResourceMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ResourceMetricStatus)(nil), (*autoscaling.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(a.(*v1.ResourceMetricStatus), b.(*autoscaling.ResourceMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ResourceMetricStatus)(nil), (*v1.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(a.(*autoscaling.ResourceMetricStatus), b.(*v1.ResourceMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.Scale)(nil), (*autoscaling.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_Scale_To_autoscaling_Scale(a.(*v1.Scale), b.(*autoscaling.Scale), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.Scale)(nil), (*v1.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_Scale_To_v1_Scale(a.(*autoscaling.Scale), b.(*v1.Scale), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ScaleSpec)(nil), (*autoscaling.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec(a.(*v1.ScaleSpec), b.(*autoscaling.ScaleSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ScaleSpec)(nil), (*v1.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ScaleSpec_To_v1_ScaleSpec(a.(*autoscaling.ScaleSpec), b.(*v1.ScaleSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ScaleStatus)(nil), (*autoscaling.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus(a.(*v1.ScaleStatus), b.(*autoscaling.ScaleStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ScaleStatus)(nil), (*v1.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus(a.(*autoscaling.ScaleStatus), b.(*v1.ScaleStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ExternalMetricSource)(nil), (*v1.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(a.(*autoscaling.ExternalMetricSource), b.(*v1.ExternalMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ExternalMetricStatus)(nil), (*v1.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(a.(*autoscaling.ExternalMetricStatus), b.(*v1.ExternalMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.HorizontalPodAutoscalerSpec)(nil), (*v1.HorizontalPodAutoscalerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(a.(*autoscaling.HorizontalPodAutoscalerSpec), b.(*v1.HorizontalPodAutoscalerSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.HorizontalPodAutoscalerStatus)(nil), (*v1.HorizontalPodAutoscalerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(a.(*autoscaling.HorizontalPodAutoscalerStatus), b.(*v1.HorizontalPodAutoscalerStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.HorizontalPodAutoscaler)(nil), (*v1.HorizontalPodAutoscaler)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(a.(*autoscaling.HorizontalPodAutoscaler), b.(*v1.HorizontalPodAutoscaler), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.MetricTarget)(nil), (*v1.CrossVersionObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_MetricTarget_To_v1_CrossVersionObjectReference(a.(*autoscaling.MetricTarget), b.(*v1.CrossVersionObjectReference), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ObjectMetricSource)(nil), (*v1.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(a.(*autoscaling.ObjectMetricSource), b.(*v1.ObjectMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ObjectMetricStatus)(nil), (*v1.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(a.(*autoscaling.ObjectMetricStatus), b.(*v1.ObjectMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.PodsMetricSource)(nil), (*v1.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(a.(*autoscaling.PodsMetricSource), b.(*v1.PodsMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.PodsMetricStatus)(nil), (*v1.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(a.(*autoscaling.PodsMetricStatus), b.(*v1.PodsMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ResourceMetricSource)(nil), (*v1.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(a.(*autoscaling.ResourceMetricSource), b.(*v1.ResourceMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ResourceMetricStatus)(nil), (*v1.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(a.(*autoscaling.ResourceMetricStatus), b.(*v1.ResourceMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.CrossVersionObjectReference)(nil), (*autoscaling.MetricTarget)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_CrossVersionObjectReference_To_autoscaling_MetricTarget(a.(*v1.CrossVersionObjectReference), b.(*autoscaling.MetricTarget), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.ExternalMetricSource)(nil), (*autoscaling.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(a.(*v1.ExternalMetricSource), b.(*autoscaling.ExternalMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.ExternalMetricStatus)(nil), (*autoscaling.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(a.(*v1.ExternalMetricStatus), b.(*autoscaling.ExternalMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.HorizontalPodAutoscalerSpec)(nil), (*autoscaling.HorizontalPodAutoscalerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(a.(*v1.HorizontalPodAutoscalerSpec), b.(*autoscaling.HorizontalPodAutoscalerSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.HorizontalPodAutoscalerStatus)(nil), (*autoscaling.HorizontalPodAutoscalerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(a.(*v1.HorizontalPodAutoscalerStatus), b.(*autoscaling.HorizontalPodAutoscalerStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.HorizontalPodAutoscaler)(nil), (*autoscaling.HorizontalPodAutoscaler)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(a.(*v1.HorizontalPodAutoscaler), b.(*autoscaling.HorizontalPodAutoscaler), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.ObjectMetricSource)(nil), (*autoscaling.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(a.(*v1.ObjectMetricSource), b.(*autoscaling.ObjectMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.ObjectMetricStatus)(nil), (*autoscaling.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(a.(*v1.ObjectMetricStatus), b.(*autoscaling.ObjectMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.PodsMetricSource)(nil), (*autoscaling.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(a.(*v1.PodsMetricSource), b.(*autoscaling.PodsMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.PodsMetricStatus)(nil), (*autoscaling.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(a.(*v1.PodsMetricStatus), b.(*autoscaling.PodsMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.ResourceMetricSource)(nil), (*autoscaling.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(a.(*v1.ResourceMetricSource), b.(*autoscaling.ResourceMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v1.ResourceMetricStatus)(nil), (*autoscaling.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(a.(*v1.ResourceMetricStatus), b.(*autoscaling.ResourceMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(in *v1.CrossVersionObjectReference, out *autoscaling.CrossVersionObjectReference, s conversion.Scope) error {
|
||||
@ -107,57 +377,33 @@ func Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectRef
|
||||
}
|
||||
|
||||
func autoConvert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *v1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.MetricSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
|
||||
out.TargetValue = (*resource.Quantity)(unsafe.Pointer(in.TargetValue))
|
||||
out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.MetricSelector requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource is an autogenerated conversion function.
|
||||
func Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *v1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *v1.ExternalMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.MetricSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
|
||||
out.TargetValue = (*resource.Quantity)(unsafe.Pointer(in.TargetValue))
|
||||
out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Target requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *v1.ExternalMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *v1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.MetricSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
|
||||
out.CurrentValue = in.CurrentValue
|
||||
out.CurrentAverageValue = (*resource.Quantity)(unsafe.Pointer(in.CurrentAverageValue))
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.MetricSelector requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus is an autogenerated conversion function.
|
||||
func Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *v1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *v1.ExternalMetricStatus, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.MetricSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
|
||||
out.CurrentValue = in.CurrentValue
|
||||
out.CurrentAverageValue = (*resource.Quantity)(unsafe.Pointer(in.CurrentAverageValue))
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Current requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *v1.ExternalMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *v1.HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
if err := Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
@ -196,7 +442,7 @@ func Convert_v1_HorizontalPodAutoscalerCondition_To_autoscaling_HorizontalPodAut
|
||||
|
||||
func autoConvert_autoscaling_HorizontalPodAutoscalerCondition_To_v1_HorizontalPodAutoscalerCondition(in *autoscaling.HorizontalPodAutoscalerCondition, out *v1.HorizontalPodAutoscalerCondition, s conversion.Scope) error {
|
||||
out.Type = v1.HorizontalPodAutoscalerConditionType(in.Type)
|
||||
out.Status = core_v1.ConditionStatus(in.Status)
|
||||
out.Status = corev1.ConditionStatus(in.Status)
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
@ -272,7 +518,7 @@ func autoConvert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAuto
|
||||
|
||||
func autoConvert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in *v1.HorizontalPodAutoscalerStatus, out *autoscaling.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
|
||||
out.LastScaleTime = (*meta_v1.Time)(unsafe.Pointer(in.LastScaleTime))
|
||||
out.LastScaleTime = (*metav1.Time)(unsafe.Pointer(in.LastScaleTime))
|
||||
out.CurrentReplicas = in.CurrentReplicas
|
||||
out.DesiredReplicas = in.DesiredReplicas
|
||||
// WARNING: in.CurrentCPUUtilizationPercentage requires manual conversion: does not exist in peer-type
|
||||
@ -281,7 +527,7 @@ func autoConvert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAu
|
||||
|
||||
func autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in *autoscaling.HorizontalPodAutoscalerStatus, out *v1.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
|
||||
out.LastScaleTime = (*meta_v1.Time)(unsafe.Pointer(in.LastScaleTime))
|
||||
out.LastScaleTime = (*metav1.Time)(unsafe.Pointer(in.LastScaleTime))
|
||||
out.CurrentReplicas = in.CurrentReplicas
|
||||
out.DesiredReplicas = in.DesiredReplicas
|
||||
// WARNING: in.CurrentMetrics requires manual conversion: does not exist in peer-type
|
||||
@ -291,10 +537,42 @@ func autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAu
|
||||
|
||||
func autoConvert_v1_MetricSpec_To_autoscaling_MetricSpec(in *v1.MetricSpec, out *autoscaling.MetricSpec, s conversion.Scope) error {
|
||||
out.Type = autoscaling.MetricSourceType(in.Type)
|
||||
out.Object = (*autoscaling.ObjectMetricSource)(unsafe.Pointer(in.Object))
|
||||
out.Pods = (*autoscaling.PodsMetricSource)(unsafe.Pointer(in.Pods))
|
||||
out.Resource = (*autoscaling.ResourceMetricSource)(unsafe.Pointer(in.Resource))
|
||||
out.External = (*autoscaling.ExternalMetricSource)(unsafe.Pointer(in.External))
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
*out = new(autoscaling.ObjectMetricSource)
|
||||
if err := Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Object = nil
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
*out = new(autoscaling.PodsMetricSource)
|
||||
if err := Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pods = nil
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
*out = new(autoscaling.ResourceMetricSource)
|
||||
if err := Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Resource = nil
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
*out = new(autoscaling.ExternalMetricSource)
|
||||
if err := Convert_v1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.External = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -305,10 +583,42 @@ func Convert_v1_MetricSpec_To_autoscaling_MetricSpec(in *v1.MetricSpec, out *aut
|
||||
|
||||
func autoConvert_autoscaling_MetricSpec_To_v1_MetricSpec(in *autoscaling.MetricSpec, out *v1.MetricSpec, s conversion.Scope) error {
|
||||
out.Type = v1.MetricSourceType(in.Type)
|
||||
out.Object = (*v1.ObjectMetricSource)(unsafe.Pointer(in.Object))
|
||||
out.Pods = (*v1.PodsMetricSource)(unsafe.Pointer(in.Pods))
|
||||
out.Resource = (*v1.ResourceMetricSource)(unsafe.Pointer(in.Resource))
|
||||
out.External = (*v1.ExternalMetricSource)(unsafe.Pointer(in.External))
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
*out = new(v1.ObjectMetricSource)
|
||||
if err := Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Object = nil
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
*out = new(v1.PodsMetricSource)
|
||||
if err := Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pods = nil
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
*out = new(v1.ResourceMetricSource)
|
||||
if err := Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Resource = nil
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
*out = new(v1.ExternalMetricSource)
|
||||
if err := Convert_autoscaling_ExternalMetricSource_To_v1_ExternalMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.External = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -319,10 +629,42 @@ func Convert_autoscaling_MetricSpec_To_v1_MetricSpec(in *autoscaling.MetricSpec,
|
||||
|
||||
func autoConvert_v1_MetricStatus_To_autoscaling_MetricStatus(in *v1.MetricStatus, out *autoscaling.MetricStatus, s conversion.Scope) error {
|
||||
out.Type = autoscaling.MetricSourceType(in.Type)
|
||||
out.Object = (*autoscaling.ObjectMetricStatus)(unsafe.Pointer(in.Object))
|
||||
out.Pods = (*autoscaling.PodsMetricStatus)(unsafe.Pointer(in.Pods))
|
||||
out.Resource = (*autoscaling.ResourceMetricStatus)(unsafe.Pointer(in.Resource))
|
||||
out.External = (*autoscaling.ExternalMetricStatus)(unsafe.Pointer(in.External))
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
*out = new(autoscaling.ObjectMetricStatus)
|
||||
if err := Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Object = nil
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
*out = new(autoscaling.PodsMetricStatus)
|
||||
if err := Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pods = nil
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
*out = new(autoscaling.ResourceMetricStatus)
|
||||
if err := Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Resource = nil
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
*out = new(autoscaling.ExternalMetricStatus)
|
||||
if err := Convert_v1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.External = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -333,10 +675,42 @@ func Convert_v1_MetricStatus_To_autoscaling_MetricStatus(in *v1.MetricStatus, ou
|
||||
|
||||
func autoConvert_autoscaling_MetricStatus_To_v1_MetricStatus(in *autoscaling.MetricStatus, out *v1.MetricStatus, s conversion.Scope) error {
|
||||
out.Type = v1.MetricSourceType(in.Type)
|
||||
out.Object = (*v1.ObjectMetricStatus)(unsafe.Pointer(in.Object))
|
||||
out.Pods = (*v1.PodsMetricStatus)(unsafe.Pointer(in.Pods))
|
||||
out.Resource = (*v1.ResourceMetricStatus)(unsafe.Pointer(in.Resource))
|
||||
out.External = (*v1.ExternalMetricStatus)(unsafe.Pointer(in.External))
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
*out = new(v1.ObjectMetricStatus)
|
||||
if err := Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Object = nil
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
*out = new(v1.PodsMetricStatus)
|
||||
if err := Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pods = nil
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
*out = new(v1.ResourceMetricStatus)
|
||||
if err := Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Resource = nil
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
*out = new(v1.ExternalMetricStatus)
|
||||
if err := Convert_autoscaling_ExternalMetricStatus_To_v1_ExternalMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.External = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -346,153 +720,93 @@ func Convert_autoscaling_MetricStatus_To_v1_MetricStatus(in *autoscaling.MetricS
|
||||
}
|
||||
|
||||
func autoConvert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *v1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
|
||||
if err := Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
if err := Convert_v1_CrossVersionObjectReference_To_autoscaling_MetricTarget(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MetricName = in.MetricName
|
||||
out.TargetValue = in.TargetValue
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Selector requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.AverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource is an autogenerated conversion function.
|
||||
func Convert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *v1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_v1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *v1.ObjectMetricSource, s conversion.Scope) error {
|
||||
if err := Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
// WARNING: in.DescribedObject requires manual conversion: does not exist in peer-type
|
||||
if err := Convert_autoscaling_MetricTarget_To_v1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MetricName = in.MetricName
|
||||
out.TargetValue = in.TargetValue
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *v1.ObjectMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ObjectMetricSource_To_v1_ObjectMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *v1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
|
||||
if err := Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MetricName = in.MetricName
|
||||
out.CurrentValue = in.CurrentValue
|
||||
// WARNING: in.Target requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Selector requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.AverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus is an autogenerated conversion function.
|
||||
func Convert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *v1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *v1.ObjectMetricStatus, s conversion.Scope) error {
|
||||
if err := Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MetricName = in.MetricName
|
||||
out.CurrentValue = in.CurrentValue
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Current requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.DescribedObject requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *v1.ObjectMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ObjectMetricStatus_To_v1_ObjectMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *v1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.TargetAverageValue = in.TargetAverageValue
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Selector requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource is an autogenerated conversion function.
|
||||
func Convert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *v1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_v1_PodsMetricSource_To_autoscaling_PodsMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *v1.PodsMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.TargetAverageValue = in.TargetAverageValue
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Target requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource is an autogenerated conversion function.
|
||||
func Convert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *v1.PodsMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_PodsMetricSource_To_v1_PodsMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *v1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.CurrentAverageValue = in.CurrentAverageValue
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Selector requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus is an autogenerated conversion function.
|
||||
func Convert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *v1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *v1.PodsMetricStatus, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.CurrentAverageValue = in.CurrentAverageValue
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Current requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus is an autogenerated conversion function.
|
||||
func Convert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *v1.PodsMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_PodsMetricStatus_To_v1_PodsMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *v1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
|
||||
out.Name = core.ResourceName(in.Name)
|
||||
out.TargetAverageUtilization = (*int32)(unsafe.Pointer(in.TargetAverageUtilization))
|
||||
out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
|
||||
// WARNING: in.TargetAverageUtilization requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource is an autogenerated conversion function.
|
||||
func Convert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *v1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_v1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *v1.ResourceMetricSource, s conversion.Scope) error {
|
||||
out.Name = core_v1.ResourceName(in.Name)
|
||||
out.TargetAverageUtilization = (*int32)(unsafe.Pointer(in.TargetAverageUtilization))
|
||||
out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
|
||||
out.Name = corev1.ResourceName(in.Name)
|
||||
// WARNING: in.Target requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *v1.ResourceMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ResourceMetricSource_To_v1_ResourceMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *v1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
|
||||
out.Name = core.ResourceName(in.Name)
|
||||
out.CurrentAverageUtilization = (*int32)(unsafe.Pointer(in.CurrentAverageUtilization))
|
||||
out.CurrentAverageValue = in.CurrentAverageValue
|
||||
// WARNING: in.CurrentAverageUtilization requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus is an autogenerated conversion function.
|
||||
func Convert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *v1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *v1.ResourceMetricStatus, s conversion.Scope) error {
|
||||
out.Name = core_v1.ResourceName(in.Name)
|
||||
out.CurrentAverageUtilization = (*int32)(unsafe.Pointer(in.CurrentAverageUtilization))
|
||||
out.CurrentAverageValue = in.CurrentAverageValue
|
||||
out.Name = corev1.ResourceName(in.Name)
|
||||
// WARNING: in.Current requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *v1.ResourceMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ResourceMetricStatus_To_v1_ResourceMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_Scale_To_autoscaling_Scale(in *v1.Scale, out *autoscaling.Scale, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
if err := Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
|
58
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/BUILD
generated
vendored
58
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/BUILD
generated
vendored
@ -1,14 +1,9 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
"go_test",
|
||||
)
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"conversion.go",
|
||||
"defaults.go",
|
||||
"doc.go",
|
||||
"register.go",
|
||||
@ -16,16 +11,33 @@ go_library(
|
||||
"zz_generated.defaults.go",
|
||||
],
|
||||
importpath = "k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//pkg/apis/autoscaling:go_default_library",
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//vendor/k8s.io/api/autoscaling/v2beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
"//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["defaults_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//pkg/api/legacyscheme:go_default_library",
|
||||
"//pkg/apis/autoscaling:go_default_library",
|
||||
"//pkg/apis/autoscaling/install:go_default_library",
|
||||
"//pkg/apis/core/install:go_default_library",
|
||||
"//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/utils/pointer:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@ -40,21 +52,5 @@ filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_xtest",
|
||||
srcs = ["defaults_test.go"],
|
||||
deps = [
|
||||
":go_default_library",
|
||||
"//pkg/api/legacyscheme:go_default_library",
|
||||
"//pkg/apis/autoscaling:go_default_library",
|
||||
"//pkg/apis/autoscaling/install:go_default_library",
|
||||
"//pkg/apis/core/install:go_default_library",
|
||||
"//pkg/util/pointer:go_default_library",
|
||||
"//vendor/k8s.io/api/autoscaling/v2beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
290
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/conversion.go
generated
vendored
Normal file
290
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/conversion.go
generated
vendored
Normal file
@ -0,0 +1,290 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta1
|
||||
|
||||
import (
|
||||
autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
core "k8s.io/kubernetes/pkg/apis/core"
|
||||
)
|
||||
|
||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
// Add non-generated conversion functions
|
||||
err := scheme.AddConversionFuncs(
|
||||
Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource,
|
||||
Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource,
|
||||
Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource,
|
||||
Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource,
|
||||
Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource,
|
||||
Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource,
|
||||
Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus,
|
||||
Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus,
|
||||
Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus,
|
||||
Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus,
|
||||
Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus,
|
||||
Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus,
|
||||
Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource,
|
||||
Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource,
|
||||
Convert_autoscaling_MetricTarget_To_v2beta1_CrossVersionObjectReference,
|
||||
Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_MetricTarget,
|
||||
Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus,
|
||||
Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus,
|
||||
Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler,
|
||||
Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_MetricTarget_To_v2beta1_CrossVersionObjectReference(in *autoscaling.MetricTarget, out *autoscalingv2beta1.CrossVersionObjectReference, s conversion.Scope) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_MetricTarget(in *autoscalingv2beta1.CrossVersionObjectReference, out *autoscaling.MetricTarget, s conversion.Scope) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *autoscalingv2beta1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
|
||||
out.Name = core.ResourceName(in.Name)
|
||||
utilization := in.CurrentAverageUtilization
|
||||
averageValue := in.CurrentAverageValue
|
||||
out.Current = autoscaling.MetricValueStatus{
|
||||
AverageValue: &averageValue,
|
||||
AverageUtilization: utilization,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *autoscalingv2beta1.ResourceMetricStatus, s conversion.Scope) error {
|
||||
out.Name = v1.ResourceName(in.Name)
|
||||
out.CurrentAverageUtilization = in.Current.AverageUtilization
|
||||
if in.Current.AverageValue != nil {
|
||||
out.CurrentAverageValue = *in.Current.AverageValue
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *autoscalingv2beta1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
|
||||
out.Name = core.ResourceName(in.Name)
|
||||
utilization := in.TargetAverageUtilization
|
||||
averageValue := in.TargetAverageValue
|
||||
|
||||
var metricType autoscaling.MetricTargetType
|
||||
if utilization == nil {
|
||||
metricType = autoscaling.AverageValueMetricType
|
||||
} else {
|
||||
metricType = autoscaling.UtilizationMetricType
|
||||
}
|
||||
out.Target = autoscaling.MetricTarget{
|
||||
Type: metricType,
|
||||
AverageValue: averageValue,
|
||||
AverageUtilization: utilization,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *autoscalingv2beta1.ResourceMetricSource, s conversion.Scope) error {
|
||||
out.Name = v1.ResourceName(in.Name)
|
||||
out.TargetAverageUtilization = in.Target.AverageUtilization
|
||||
out.TargetAverageValue = in.Target.AverageValue
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *autoscalingv2beta1.ExternalMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.Metric.Name
|
||||
out.TargetValue = in.Target.Value
|
||||
out.TargetAverageValue = in.Target.AverageValue
|
||||
out.MetricSelector = in.Metric.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *autoscalingv2beta1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
|
||||
value := in.TargetValue
|
||||
averageValue := in.TargetAverageValue
|
||||
|
||||
var metricType autoscaling.MetricTargetType
|
||||
if value == nil {
|
||||
metricType = autoscaling.AverageValueMetricType
|
||||
} else {
|
||||
metricType = autoscaling.ValueMetricType
|
||||
}
|
||||
|
||||
out.Target = autoscaling.MetricTarget{
|
||||
Type: metricType,
|
||||
Value: value,
|
||||
AverageValue: averageValue,
|
||||
}
|
||||
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.MetricSelector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *autoscalingv2beta1.ObjectMetricSource, s conversion.Scope) error {
|
||||
if in.Target.Value != nil {
|
||||
out.TargetValue = *in.Target.Value
|
||||
}
|
||||
out.AverageValue = in.Target.AverageValue
|
||||
|
||||
out.Target = autoscalingv2beta1.CrossVersionObjectReference{
|
||||
Kind: in.DescribedObject.Kind,
|
||||
Name: in.DescribedObject.Name,
|
||||
APIVersion: in.DescribedObject.APIVersion,
|
||||
}
|
||||
out.MetricName = in.Metric.Name
|
||||
out.Selector = in.Metric.Selector
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *autoscalingv2beta1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
|
||||
var metricType autoscaling.MetricTargetType
|
||||
if in.AverageValue == nil {
|
||||
metricType = autoscaling.ValueMetricType
|
||||
} else {
|
||||
metricType = autoscaling.AverageValueMetricType
|
||||
}
|
||||
out.Target = autoscaling.MetricTarget{
|
||||
Type: metricType,
|
||||
Value: &in.TargetValue,
|
||||
AverageValue: in.AverageValue,
|
||||
}
|
||||
out.DescribedObject = autoscaling.CrossVersionObjectReference{
|
||||
Kind: in.Target.Kind,
|
||||
Name: in.Target.Name,
|
||||
APIVersion: in.Target.APIVersion,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.Selector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *autoscalingv2beta1.PodsMetricSource, s conversion.Scope) error {
|
||||
targetAverageValue := *in.Target.AverageValue
|
||||
out.TargetAverageValue = targetAverageValue
|
||||
|
||||
out.MetricName = in.Metric.Name
|
||||
out.Selector = in.Metric.Selector
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *autoscalingv2beta1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
|
||||
targetAverageValue := &in.TargetAverageValue
|
||||
var metricType autoscaling.MetricTargetType
|
||||
metricType = autoscaling.AverageValueMetricType
|
||||
|
||||
out.Target = autoscaling.MetricTarget{
|
||||
Type: metricType,
|
||||
AverageValue: targetAverageValue,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.Selector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *autoscalingv2beta1.ExternalMetricStatus, s conversion.Scope) error {
|
||||
if &in.Current.AverageValue != nil {
|
||||
out.CurrentAverageValue = in.Current.AverageValue
|
||||
}
|
||||
out.MetricName = in.Metric.Name
|
||||
if in.Current.Value != nil {
|
||||
out.CurrentValue = *in.Current.Value
|
||||
}
|
||||
out.MetricSelector = in.Metric.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *autoscalingv2beta1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
|
||||
value := in.CurrentValue
|
||||
averageValue := in.CurrentAverageValue
|
||||
out.Current = autoscaling.MetricValueStatus{
|
||||
Value: &value,
|
||||
AverageValue: averageValue,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.MetricSelector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *autoscalingv2beta1.ObjectMetricStatus, s conversion.Scope) error {
|
||||
if in.Current.Value != nil {
|
||||
out.CurrentValue = *in.Current.Value
|
||||
}
|
||||
out.Target = autoscalingv2beta1.CrossVersionObjectReference{
|
||||
Kind: in.DescribedObject.Kind,
|
||||
Name: in.DescribedObject.Name,
|
||||
APIVersion: in.DescribedObject.APIVersion,
|
||||
}
|
||||
out.MetricName = in.Metric.Name
|
||||
out.Selector = in.Metric.Selector
|
||||
currentAverageValue := *in.Current.AverageValue
|
||||
out.AverageValue = ¤tAverageValue
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *autoscalingv2beta1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
|
||||
out.Current = autoscaling.MetricValueStatus{
|
||||
Value: &in.CurrentValue,
|
||||
AverageValue: in.AverageValue,
|
||||
}
|
||||
out.DescribedObject = autoscaling.CrossVersionObjectReference{
|
||||
Kind: in.Target.Kind,
|
||||
Name: in.Target.Name,
|
||||
APIVersion: in.Target.APIVersion,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.Selector,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *autoscalingv2beta1.PodsMetricStatus, s conversion.Scope) error {
|
||||
if in.Current.AverageValue != nil {
|
||||
out.CurrentAverageValue = *in.Current.AverageValue
|
||||
}
|
||||
out.MetricName = in.Metric.Name
|
||||
out.Selector = in.Metric.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *autoscalingv2beta1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
|
||||
out.Current = autoscaling.MetricValueStatus{
|
||||
AverageValue: &in.CurrentAverageValue,
|
||||
}
|
||||
out.Metric = autoscaling.MetricIdentifier{
|
||||
Name: in.MetricName,
|
||||
Selector: in.Selector,
|
||||
}
|
||||
return nil
|
||||
}
|
2
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/defaults.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/defaults.go
generated
vendored
@ -39,7 +39,7 @@ func SetDefaults_HorizontalPodAutoscaler(obj *autoscalingv2beta1.HorizontalPodAu
|
||||
{
|
||||
Type: autoscalingv2beta1.ResourceMetricSourceType,
|
||||
Resource: &autoscalingv2beta1.ResourceMetricSource{
|
||||
Name: v1.ResourceCPU,
|
||||
Name: v1.ResourceCPU,
|
||||
TargetAverageUtilization: &utilizationDefaultVal,
|
||||
},
|
||||
},
|
||||
|
4
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/defaults_test.go
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/defaults_test.go
generated
vendored
@ -29,7 +29,7 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
|
||||
. "k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1"
|
||||
_ "k8s.io/kubernetes/pkg/apis/core/install"
|
||||
utilpointer "k8s.io/kubernetes/pkg/util/pointer"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
func TestSetDefaultHPA(t *testing.T) {
|
||||
@ -39,7 +39,7 @@ func TestSetDefaultHPA(t *testing.T) {
|
||||
{
|
||||
Type: autoscalingv2beta1.ResourceMetricSourceType,
|
||||
Resource: &autoscalingv2beta1.ResourceMetricSource{
|
||||
Name: v1.ResourceCPU,
|
||||
Name: v1.ResourceCPU,
|
||||
TargetAverageUtilization: &utilizationDefaultVal,
|
||||
},
|
||||
},
|
||||
|
2
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/register.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/register.go
generated
vendored
@ -41,5 +41,5 @@ func init() {
|
||||
// We only register manually written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The separation
|
||||
// makes the code compile even when the generated files are missing.
|
||||
localSchemeBuilder.Register(addDefaultingFuncs)
|
||||
localSchemeBuilder.Register(addDefaultingFuncs, addConversionFuncs)
|
||||
}
|
||||
|
706
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/zz_generated.conversion.go
generated
vendored
706
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1/zz_generated.conversion.go
generated
vendored
@ -24,9 +24,8 @@ import (
|
||||
unsafe "unsafe"
|
||||
|
||||
v2beta1 "k8s.io/api/autoscaling/v2beta1"
|
||||
core_v1 "k8s.io/api/core/v1"
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
@ -39,41 +38,258 @@ func init() {
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedConversionFuncs(
|
||||
Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference,
|
||||
Convert_autoscaling_CrossVersionObjectReference_To_v2beta1_CrossVersionObjectReference,
|
||||
Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource,
|
||||
Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource,
|
||||
Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus,
|
||||
Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus,
|
||||
Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler,
|
||||
Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler,
|
||||
Convert_v2beta1_HorizontalPodAutoscalerCondition_To_autoscaling_HorizontalPodAutoscalerCondition,
|
||||
Convert_autoscaling_HorizontalPodAutoscalerCondition_To_v2beta1_HorizontalPodAutoscalerCondition,
|
||||
Convert_v2beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList,
|
||||
Convert_autoscaling_HorizontalPodAutoscalerList_To_v2beta1_HorizontalPodAutoscalerList,
|
||||
Convert_v2beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec,
|
||||
Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v2beta1_HorizontalPodAutoscalerSpec,
|
||||
Convert_v2beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus,
|
||||
Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v2beta1_HorizontalPodAutoscalerStatus,
|
||||
Convert_v2beta1_MetricSpec_To_autoscaling_MetricSpec,
|
||||
Convert_autoscaling_MetricSpec_To_v2beta1_MetricSpec,
|
||||
Convert_v2beta1_MetricStatus_To_autoscaling_MetricStatus,
|
||||
Convert_autoscaling_MetricStatus_To_v2beta1_MetricStatus,
|
||||
Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource,
|
||||
Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource,
|
||||
Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus,
|
||||
Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus,
|
||||
Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource,
|
||||
Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource,
|
||||
Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus,
|
||||
Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus,
|
||||
Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource,
|
||||
Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource,
|
||||
Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus,
|
||||
Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus,
|
||||
)
|
||||
func RegisterConversions(s *runtime.Scheme) error {
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.CrossVersionObjectReference)(nil), (*autoscaling.CrossVersionObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(a.(*v2beta1.CrossVersionObjectReference), b.(*autoscaling.CrossVersionObjectReference), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.CrossVersionObjectReference)(nil), (*v2beta1.CrossVersionObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_CrossVersionObjectReference_To_v2beta1_CrossVersionObjectReference(a.(*autoscaling.CrossVersionObjectReference), b.(*v2beta1.CrossVersionObjectReference), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.ExternalMetricSource)(nil), (*autoscaling.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(a.(*v2beta1.ExternalMetricSource), b.(*autoscaling.ExternalMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ExternalMetricSource)(nil), (*v2beta1.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(a.(*autoscaling.ExternalMetricSource), b.(*v2beta1.ExternalMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.ExternalMetricStatus)(nil), (*autoscaling.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(a.(*v2beta1.ExternalMetricStatus), b.(*autoscaling.ExternalMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ExternalMetricStatus)(nil), (*v2beta1.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(a.(*autoscaling.ExternalMetricStatus), b.(*v2beta1.ExternalMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.HorizontalPodAutoscaler)(nil), (*autoscaling.HorizontalPodAutoscaler)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(a.(*v2beta1.HorizontalPodAutoscaler), b.(*autoscaling.HorizontalPodAutoscaler), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscaler)(nil), (*v2beta1.HorizontalPodAutoscaler)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler(a.(*autoscaling.HorizontalPodAutoscaler), b.(*v2beta1.HorizontalPodAutoscaler), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.HorizontalPodAutoscalerCondition)(nil), (*autoscaling.HorizontalPodAutoscalerCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_HorizontalPodAutoscalerCondition_To_autoscaling_HorizontalPodAutoscalerCondition(a.(*v2beta1.HorizontalPodAutoscalerCondition), b.(*autoscaling.HorizontalPodAutoscalerCondition), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscalerCondition)(nil), (*v2beta1.HorizontalPodAutoscalerCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerCondition_To_v2beta1_HorizontalPodAutoscalerCondition(a.(*autoscaling.HorizontalPodAutoscalerCondition), b.(*v2beta1.HorizontalPodAutoscalerCondition), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.HorizontalPodAutoscalerList)(nil), (*autoscaling.HorizontalPodAutoscalerList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(a.(*v2beta1.HorizontalPodAutoscalerList), b.(*autoscaling.HorizontalPodAutoscalerList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscalerList)(nil), (*v2beta1.HorizontalPodAutoscalerList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerList_To_v2beta1_HorizontalPodAutoscalerList(a.(*autoscaling.HorizontalPodAutoscalerList), b.(*v2beta1.HorizontalPodAutoscalerList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.HorizontalPodAutoscalerSpec)(nil), (*autoscaling.HorizontalPodAutoscalerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(a.(*v2beta1.HorizontalPodAutoscalerSpec), b.(*autoscaling.HorizontalPodAutoscalerSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscalerSpec)(nil), (*v2beta1.HorizontalPodAutoscalerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v2beta1_HorizontalPodAutoscalerSpec(a.(*autoscaling.HorizontalPodAutoscalerSpec), b.(*v2beta1.HorizontalPodAutoscalerSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.HorizontalPodAutoscalerStatus)(nil), (*autoscaling.HorizontalPodAutoscalerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(a.(*v2beta1.HorizontalPodAutoscalerStatus), b.(*autoscaling.HorizontalPodAutoscalerStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.HorizontalPodAutoscalerStatus)(nil), (*v2beta1.HorizontalPodAutoscalerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v2beta1_HorizontalPodAutoscalerStatus(a.(*autoscaling.HorizontalPodAutoscalerStatus), b.(*v2beta1.HorizontalPodAutoscalerStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.MetricSpec)(nil), (*autoscaling.MetricSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_MetricSpec_To_autoscaling_MetricSpec(a.(*v2beta1.MetricSpec), b.(*autoscaling.MetricSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.MetricSpec)(nil), (*v2beta1.MetricSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_MetricSpec_To_v2beta1_MetricSpec(a.(*autoscaling.MetricSpec), b.(*v2beta1.MetricSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.MetricStatus)(nil), (*autoscaling.MetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_MetricStatus_To_autoscaling_MetricStatus(a.(*v2beta1.MetricStatus), b.(*autoscaling.MetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.MetricStatus)(nil), (*v2beta1.MetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_MetricStatus_To_v2beta1_MetricStatus(a.(*autoscaling.MetricStatus), b.(*v2beta1.MetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.ObjectMetricSource)(nil), (*autoscaling.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(a.(*v2beta1.ObjectMetricSource), b.(*autoscaling.ObjectMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ObjectMetricSource)(nil), (*v2beta1.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(a.(*autoscaling.ObjectMetricSource), b.(*v2beta1.ObjectMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.ObjectMetricStatus)(nil), (*autoscaling.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(a.(*v2beta1.ObjectMetricStatus), b.(*autoscaling.ObjectMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ObjectMetricStatus)(nil), (*v2beta1.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(a.(*autoscaling.ObjectMetricStatus), b.(*v2beta1.ObjectMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.PodsMetricSource)(nil), (*autoscaling.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(a.(*v2beta1.PodsMetricSource), b.(*autoscaling.PodsMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.PodsMetricSource)(nil), (*v2beta1.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(a.(*autoscaling.PodsMetricSource), b.(*v2beta1.PodsMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.PodsMetricStatus)(nil), (*autoscaling.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(a.(*v2beta1.PodsMetricStatus), b.(*autoscaling.PodsMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.PodsMetricStatus)(nil), (*v2beta1.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(a.(*autoscaling.PodsMetricStatus), b.(*v2beta1.PodsMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.ResourceMetricSource)(nil), (*autoscaling.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(a.(*v2beta1.ResourceMetricSource), b.(*autoscaling.ResourceMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ResourceMetricSource)(nil), (*v2beta1.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(a.(*autoscaling.ResourceMetricSource), b.(*v2beta1.ResourceMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v2beta1.ResourceMetricStatus)(nil), (*autoscaling.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(a.(*v2beta1.ResourceMetricStatus), b.(*autoscaling.ResourceMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*autoscaling.ResourceMetricStatus)(nil), (*v2beta1.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(a.(*autoscaling.ResourceMetricStatus), b.(*v2beta1.ResourceMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ExternalMetricSource)(nil), (*v2beta1.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(a.(*autoscaling.ExternalMetricSource), b.(*v2beta1.ExternalMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ExternalMetricStatus)(nil), (*v2beta1.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(a.(*autoscaling.ExternalMetricStatus), b.(*v2beta1.ExternalMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.MetricTarget)(nil), (*v2beta1.CrossVersionObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_MetricTarget_To_v2beta1_CrossVersionObjectReference(a.(*autoscaling.MetricTarget), b.(*v2beta1.CrossVersionObjectReference), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ObjectMetricSource)(nil), (*v2beta1.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(a.(*autoscaling.ObjectMetricSource), b.(*v2beta1.ObjectMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ObjectMetricStatus)(nil), (*v2beta1.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(a.(*autoscaling.ObjectMetricStatus), b.(*v2beta1.ObjectMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.PodsMetricSource)(nil), (*v2beta1.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(a.(*autoscaling.PodsMetricSource), b.(*v2beta1.PodsMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.PodsMetricStatus)(nil), (*v2beta1.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(a.(*autoscaling.PodsMetricStatus), b.(*v2beta1.PodsMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ResourceMetricSource)(nil), (*v2beta1.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(a.(*autoscaling.ResourceMetricSource), b.(*v2beta1.ResourceMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*autoscaling.ResourceMetricStatus)(nil), (*v2beta1.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(a.(*autoscaling.ResourceMetricStatus), b.(*v2beta1.ResourceMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v2beta1.CrossVersionObjectReference)(nil), (*autoscaling.MetricTarget)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_MetricTarget(a.(*v2beta1.CrossVersionObjectReference), b.(*autoscaling.MetricTarget), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v2beta1.ExternalMetricSource)(nil), (*autoscaling.ExternalMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(a.(*v2beta1.ExternalMetricSource), b.(*autoscaling.ExternalMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v2beta1.ExternalMetricStatus)(nil), (*autoscaling.ExternalMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(a.(*v2beta1.ExternalMetricStatus), b.(*autoscaling.ExternalMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v2beta1.ObjectMetricSource)(nil), (*autoscaling.ObjectMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(a.(*v2beta1.ObjectMetricSource), b.(*autoscaling.ObjectMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v2beta1.ObjectMetricStatus)(nil), (*autoscaling.ObjectMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(a.(*v2beta1.ObjectMetricStatus), b.(*autoscaling.ObjectMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v2beta1.PodsMetricSource)(nil), (*autoscaling.PodsMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(a.(*v2beta1.PodsMetricSource), b.(*autoscaling.PodsMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v2beta1.PodsMetricStatus)(nil), (*autoscaling.PodsMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(a.(*v2beta1.PodsMetricStatus), b.(*autoscaling.PodsMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v2beta1.ResourceMetricSource)(nil), (*autoscaling.ResourceMetricSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(a.(*v2beta1.ResourceMetricSource), b.(*autoscaling.ResourceMetricSource), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*v2beta1.ResourceMetricStatus)(nil), (*autoscaling.ResourceMetricStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(a.(*v2beta1.ResourceMetricStatus), b.(*autoscaling.ResourceMetricStatus), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(in *v2beta1.CrossVersionObjectReference, out *autoscaling.CrossVersionObjectReference, s conversion.Scope) error {
|
||||
@ -101,57 +317,33 @@ func Convert_autoscaling_CrossVersionObjectReference_To_v2beta1_CrossVersionObje
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *v2beta1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.MetricSelector = (*v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
|
||||
out.TargetValue = (*resource.Quantity)(unsafe.Pointer(in.TargetValue))
|
||||
out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.MetricSelector requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource is an autogenerated conversion function.
|
||||
func Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in *v2beta1.ExternalMetricSource, out *autoscaling.ExternalMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *v2beta1.ExternalMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.MetricSelector = (*v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
|
||||
out.TargetValue = (*resource.Quantity)(unsafe.Pointer(in.TargetValue))
|
||||
out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Target requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(in *autoscaling.ExternalMetricSource, out *v2beta1.ExternalMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *v2beta1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.MetricSelector = (*v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
|
||||
out.CurrentValue = in.CurrentValue
|
||||
out.CurrentAverageValue = (*resource.Quantity)(unsafe.Pointer(in.CurrentAverageValue))
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.MetricSelector requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus is an autogenerated conversion function.
|
||||
func Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in *v2beta1.ExternalMetricStatus, out *autoscaling.ExternalMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *v2beta1.ExternalMetricStatus, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.MetricSelector = (*v1.LabelSelector)(unsafe.Pointer(in.MetricSelector))
|
||||
out.CurrentValue = in.CurrentValue
|
||||
out.CurrentAverageValue = (*resource.Quantity)(unsafe.Pointer(in.CurrentAverageValue))
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Current requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(in *autoscaling.ExternalMetricStatus, out *v2beta1.ExternalMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *v2beta1.HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
if err := Convert_v2beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
@ -200,7 +392,7 @@ func Convert_v2beta1_HorizontalPodAutoscalerCondition_To_autoscaling_HorizontalP
|
||||
|
||||
func autoConvert_autoscaling_HorizontalPodAutoscalerCondition_To_v2beta1_HorizontalPodAutoscalerCondition(in *autoscaling.HorizontalPodAutoscalerCondition, out *v2beta1.HorizontalPodAutoscalerCondition, s conversion.Scope) error {
|
||||
out.Type = v2beta1.HorizontalPodAutoscalerConditionType(in.Type)
|
||||
out.Status = core_v1.ConditionStatus(in.Status)
|
||||
out.Status = v1.ConditionStatus(in.Status)
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
@ -214,7 +406,17 @@ func Convert_autoscaling_HorizontalPodAutoscalerCondition_To_v2beta1_HorizontalP
|
||||
|
||||
func autoConvert_v2beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(in *v2beta1.HorizontalPodAutoscalerList, out *autoscaling.HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]autoscaling.HorizontalPodAutoscaler)(unsafe.Pointer(&in.Items))
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]autoscaling.HorizontalPodAutoscaler, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v2beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -225,7 +427,17 @@ func Convert_v2beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAut
|
||||
|
||||
func autoConvert_autoscaling_HorizontalPodAutoscalerList_To_v2beta1_HorizontalPodAutoscalerList(in *autoscaling.HorizontalPodAutoscalerList, out *v2beta1.HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v2beta1.HorizontalPodAutoscaler)(unsafe.Pointer(&in.Items))
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]v2beta1.HorizontalPodAutoscaler, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_autoscaling_HorizontalPodAutoscaler_To_v2beta1_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -240,7 +452,17 @@ func autoConvert_v2beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPo
|
||||
}
|
||||
out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas))
|
||||
out.MaxReplicas = in.MaxReplicas
|
||||
out.Metrics = *(*[]autoscaling.MetricSpec)(unsafe.Pointer(&in.Metrics))
|
||||
if in.Metrics != nil {
|
||||
in, out := &in.Metrics, &out.Metrics
|
||||
*out = make([]autoscaling.MetricSpec, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v2beta1_MetricSpec_To_autoscaling_MetricSpec(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Metrics = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -255,7 +477,17 @@ func autoConvert_autoscaling_HorizontalPodAutoscalerSpec_To_v2beta1_HorizontalPo
|
||||
}
|
||||
out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas))
|
||||
out.MaxReplicas = in.MaxReplicas
|
||||
out.Metrics = *(*[]v2beta1.MetricSpec)(unsafe.Pointer(&in.Metrics))
|
||||
if in.Metrics != nil {
|
||||
in, out := &in.Metrics, &out.Metrics
|
||||
*out = make([]v2beta1.MetricSpec, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_autoscaling_MetricSpec_To_v2beta1_MetricSpec(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Metrics = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -266,10 +498,20 @@ func Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v2beta1_HorizontalPodAut
|
||||
|
||||
func autoConvert_v2beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in *v2beta1.HorizontalPodAutoscalerStatus, out *autoscaling.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
|
||||
out.LastScaleTime = (*v1.Time)(unsafe.Pointer(in.LastScaleTime))
|
||||
out.LastScaleTime = (*metav1.Time)(unsafe.Pointer(in.LastScaleTime))
|
||||
out.CurrentReplicas = in.CurrentReplicas
|
||||
out.DesiredReplicas = in.DesiredReplicas
|
||||
out.CurrentMetrics = *(*[]autoscaling.MetricStatus)(unsafe.Pointer(&in.CurrentMetrics))
|
||||
if in.CurrentMetrics != nil {
|
||||
in, out := &in.CurrentMetrics, &out.CurrentMetrics
|
||||
*out = make([]autoscaling.MetricStatus, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v2beta1_MetricStatus_To_autoscaling_MetricStatus(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.CurrentMetrics = nil
|
||||
}
|
||||
out.Conditions = *(*[]autoscaling.HorizontalPodAutoscalerCondition)(unsafe.Pointer(&in.Conditions))
|
||||
return nil
|
||||
}
|
||||
@ -281,10 +523,20 @@ func Convert_v2beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodA
|
||||
|
||||
func autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v2beta1_HorizontalPodAutoscalerStatus(in *autoscaling.HorizontalPodAutoscalerStatus, out *v2beta1.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
|
||||
out.LastScaleTime = (*v1.Time)(unsafe.Pointer(in.LastScaleTime))
|
||||
out.LastScaleTime = (*metav1.Time)(unsafe.Pointer(in.LastScaleTime))
|
||||
out.CurrentReplicas = in.CurrentReplicas
|
||||
out.DesiredReplicas = in.DesiredReplicas
|
||||
out.CurrentMetrics = *(*[]v2beta1.MetricStatus)(unsafe.Pointer(&in.CurrentMetrics))
|
||||
if in.CurrentMetrics != nil {
|
||||
in, out := &in.CurrentMetrics, &out.CurrentMetrics
|
||||
*out = make([]v2beta1.MetricStatus, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_autoscaling_MetricStatus_To_v2beta1_MetricStatus(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.CurrentMetrics = nil
|
||||
}
|
||||
out.Conditions = *(*[]v2beta1.HorizontalPodAutoscalerCondition)(unsafe.Pointer(&in.Conditions))
|
||||
return nil
|
||||
}
|
||||
@ -296,10 +548,42 @@ func Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v2beta1_HorizontalPodA
|
||||
|
||||
func autoConvert_v2beta1_MetricSpec_To_autoscaling_MetricSpec(in *v2beta1.MetricSpec, out *autoscaling.MetricSpec, s conversion.Scope) error {
|
||||
out.Type = autoscaling.MetricSourceType(in.Type)
|
||||
out.Object = (*autoscaling.ObjectMetricSource)(unsafe.Pointer(in.Object))
|
||||
out.Pods = (*autoscaling.PodsMetricSource)(unsafe.Pointer(in.Pods))
|
||||
out.Resource = (*autoscaling.ResourceMetricSource)(unsafe.Pointer(in.Resource))
|
||||
out.External = (*autoscaling.ExternalMetricSource)(unsafe.Pointer(in.External))
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
*out = new(autoscaling.ObjectMetricSource)
|
||||
if err := Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Object = nil
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
*out = new(autoscaling.PodsMetricSource)
|
||||
if err := Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pods = nil
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
*out = new(autoscaling.ResourceMetricSource)
|
||||
if err := Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Resource = nil
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
*out = new(autoscaling.ExternalMetricSource)
|
||||
if err := Convert_v2beta1_ExternalMetricSource_To_autoscaling_ExternalMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.External = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -310,10 +594,42 @@ func Convert_v2beta1_MetricSpec_To_autoscaling_MetricSpec(in *v2beta1.MetricSpec
|
||||
|
||||
func autoConvert_autoscaling_MetricSpec_To_v2beta1_MetricSpec(in *autoscaling.MetricSpec, out *v2beta1.MetricSpec, s conversion.Scope) error {
|
||||
out.Type = v2beta1.MetricSourceType(in.Type)
|
||||
out.Object = (*v2beta1.ObjectMetricSource)(unsafe.Pointer(in.Object))
|
||||
out.Pods = (*v2beta1.PodsMetricSource)(unsafe.Pointer(in.Pods))
|
||||
out.Resource = (*v2beta1.ResourceMetricSource)(unsafe.Pointer(in.Resource))
|
||||
out.External = (*v2beta1.ExternalMetricSource)(unsafe.Pointer(in.External))
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
*out = new(v2beta1.ObjectMetricSource)
|
||||
if err := Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Object = nil
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
*out = new(v2beta1.PodsMetricSource)
|
||||
if err := Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pods = nil
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
*out = new(v2beta1.ResourceMetricSource)
|
||||
if err := Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Resource = nil
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
*out = new(v2beta1.ExternalMetricSource)
|
||||
if err := Convert_autoscaling_ExternalMetricSource_To_v2beta1_ExternalMetricSource(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.External = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -324,10 +640,42 @@ func Convert_autoscaling_MetricSpec_To_v2beta1_MetricSpec(in *autoscaling.Metric
|
||||
|
||||
func autoConvert_v2beta1_MetricStatus_To_autoscaling_MetricStatus(in *v2beta1.MetricStatus, out *autoscaling.MetricStatus, s conversion.Scope) error {
|
||||
out.Type = autoscaling.MetricSourceType(in.Type)
|
||||
out.Object = (*autoscaling.ObjectMetricStatus)(unsafe.Pointer(in.Object))
|
||||
out.Pods = (*autoscaling.PodsMetricStatus)(unsafe.Pointer(in.Pods))
|
||||
out.Resource = (*autoscaling.ResourceMetricStatus)(unsafe.Pointer(in.Resource))
|
||||
out.External = (*autoscaling.ExternalMetricStatus)(unsafe.Pointer(in.External))
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
*out = new(autoscaling.ObjectMetricStatus)
|
||||
if err := Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Object = nil
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
*out = new(autoscaling.PodsMetricStatus)
|
||||
if err := Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pods = nil
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
*out = new(autoscaling.ResourceMetricStatus)
|
||||
if err := Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Resource = nil
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
*out = new(autoscaling.ExternalMetricStatus)
|
||||
if err := Convert_v2beta1_ExternalMetricStatus_To_autoscaling_ExternalMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.External = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -338,10 +686,42 @@ func Convert_v2beta1_MetricStatus_To_autoscaling_MetricStatus(in *v2beta1.Metric
|
||||
|
||||
func autoConvert_autoscaling_MetricStatus_To_v2beta1_MetricStatus(in *autoscaling.MetricStatus, out *v2beta1.MetricStatus, s conversion.Scope) error {
|
||||
out.Type = v2beta1.MetricSourceType(in.Type)
|
||||
out.Object = (*v2beta1.ObjectMetricStatus)(unsafe.Pointer(in.Object))
|
||||
out.Pods = (*v2beta1.PodsMetricStatus)(unsafe.Pointer(in.Pods))
|
||||
out.Resource = (*v2beta1.ResourceMetricStatus)(unsafe.Pointer(in.Resource))
|
||||
out.External = (*v2beta1.ExternalMetricStatus)(unsafe.Pointer(in.External))
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
*out = new(v2beta1.ObjectMetricStatus)
|
||||
if err := Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Object = nil
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
*out = new(v2beta1.PodsMetricStatus)
|
||||
if err := Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pods = nil
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
*out = new(v2beta1.ResourceMetricStatus)
|
||||
if err := Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Resource = nil
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
*out = new(v2beta1.ExternalMetricStatus)
|
||||
if err := Convert_autoscaling_ExternalMetricStatus_To_v2beta1_ExternalMetricStatus(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.External = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -351,149 +731,89 @@ func Convert_autoscaling_MetricStatus_To_v2beta1_MetricStatus(in *autoscaling.Me
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *v2beta1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
|
||||
if err := Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
if err := Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_MetricTarget(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MetricName = in.MetricName
|
||||
out.TargetValue = in.TargetValue
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Selector requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.AverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource is an autogenerated conversion function.
|
||||
func Convert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in *v2beta1.ObjectMetricSource, out *autoscaling.ObjectMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_v2beta1_ObjectMetricSource_To_autoscaling_ObjectMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *v2beta1.ObjectMetricSource, s conversion.Scope) error {
|
||||
if err := Convert_autoscaling_CrossVersionObjectReference_To_v2beta1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
// WARNING: in.DescribedObject requires manual conversion: does not exist in peer-type
|
||||
if err := Convert_autoscaling_MetricTarget_To_v2beta1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MetricName = in.MetricName
|
||||
out.TargetValue = in.TargetValue
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(in *autoscaling.ObjectMetricSource, out *v2beta1.ObjectMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ObjectMetricSource_To_v2beta1_ObjectMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *v2beta1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
|
||||
if err := Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MetricName = in.MetricName
|
||||
out.CurrentValue = in.CurrentValue
|
||||
// WARNING: in.Target requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Selector requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.AverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus is an autogenerated conversion function.
|
||||
func Convert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in *v2beta1.ObjectMetricStatus, out *autoscaling.ObjectMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_v2beta1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *v2beta1.ObjectMetricStatus, s conversion.Scope) error {
|
||||
if err := Convert_autoscaling_CrossVersionObjectReference_To_v2beta1_CrossVersionObjectReference(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MetricName = in.MetricName
|
||||
out.CurrentValue = in.CurrentValue
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Current requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.DescribedObject requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(in *autoscaling.ObjectMetricStatus, out *v2beta1.ObjectMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ObjectMetricStatus_To_v2beta1_ObjectMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *v2beta1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.TargetAverageValue = in.TargetAverageValue
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Selector requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource is an autogenerated conversion function.
|
||||
func Convert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(in *v2beta1.PodsMetricSource, out *autoscaling.PodsMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_v2beta1_PodsMetricSource_To_autoscaling_PodsMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *v2beta1.PodsMetricSource, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.TargetAverageValue = in.TargetAverageValue
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Target requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource is an autogenerated conversion function.
|
||||
func Convert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(in *autoscaling.PodsMetricSource, out *v2beta1.PodsMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_PodsMetricSource_To_v2beta1_PodsMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *v2beta1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.CurrentAverageValue = in.CurrentAverageValue
|
||||
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Selector requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus is an autogenerated conversion function.
|
||||
func Convert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in *v2beta1.PodsMetricStatus, out *autoscaling.PodsMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_v2beta1_PodsMetricStatus_To_autoscaling_PodsMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *v2beta1.PodsMetricStatus, s conversion.Scope) error {
|
||||
out.MetricName = in.MetricName
|
||||
out.CurrentAverageValue = in.CurrentAverageValue
|
||||
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.Current requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus is an autogenerated conversion function.
|
||||
func Convert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(in *autoscaling.PodsMetricStatus, out *v2beta1.PodsMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_PodsMetricStatus_To_v2beta1_PodsMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *v2beta1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
|
||||
out.Name = core.ResourceName(in.Name)
|
||||
out.TargetAverageUtilization = (*int32)(unsafe.Pointer(in.TargetAverageUtilization))
|
||||
out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
|
||||
// WARNING: in.TargetAverageUtilization requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.TargetAverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource is an autogenerated conversion function.
|
||||
func Convert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in *v2beta1.ResourceMetricSource, out *autoscaling.ResourceMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_v2beta1_ResourceMetricSource_To_autoscaling_ResourceMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *v2beta1.ResourceMetricSource, s conversion.Scope) error {
|
||||
out.Name = core_v1.ResourceName(in.Name)
|
||||
out.TargetAverageUtilization = (*int32)(unsafe.Pointer(in.TargetAverageUtilization))
|
||||
out.TargetAverageValue = (*resource.Quantity)(unsafe.Pointer(in.TargetAverageValue))
|
||||
out.Name = v1.ResourceName(in.Name)
|
||||
// WARNING: in.Target requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(in *autoscaling.ResourceMetricSource, out *v2beta1.ResourceMetricSource, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ResourceMetricSource_To_v2beta1_ResourceMetricSource(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *v2beta1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
|
||||
out.Name = core.ResourceName(in.Name)
|
||||
out.CurrentAverageUtilization = (*int32)(unsafe.Pointer(in.CurrentAverageUtilization))
|
||||
out.CurrentAverageValue = in.CurrentAverageValue
|
||||
// WARNING: in.CurrentAverageUtilization requires manual conversion: does not exist in peer-type
|
||||
// WARNING: in.CurrentAverageValue requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus is an autogenerated conversion function.
|
||||
func Convert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in *v2beta1.ResourceMetricStatus, out *autoscaling.ResourceMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_v2beta1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *v2beta1.ResourceMetricStatus, s conversion.Scope) error {
|
||||
out.Name = core_v1.ResourceName(in.Name)
|
||||
out.CurrentAverageUtilization = (*int32)(unsafe.Pointer(in.CurrentAverageUtilization))
|
||||
out.CurrentAverageValue = in.CurrentAverageValue
|
||||
out.Name = v1.ResourceName(in.Name)
|
||||
// WARNING: in.Current requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus is an autogenerated conversion function.
|
||||
func Convert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(in *autoscaling.ResourceMetricStatus, out *v2beta1.ResourceMetricStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ResourceMetricStatus_To_v2beta1_ResourceMetricStatus(in, out, s)
|
||||
}
|
||||
|
35
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/BUILD
generated
vendored
Normal file
35
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/BUILD
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"defaults.go",
|
||||
"doc.go",
|
||||
"register.go",
|
||||
"zz_generated.conversion.go",
|
||||
"zz_generated.defaults.go",
|
||||
],
|
||||
importpath = "k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//pkg/apis/autoscaling:go_default_library",
|
||||
"//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
51
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/defaults.go
generated
vendored
Normal file
51
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/defaults.go
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
)
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
return RegisterDefaults(scheme)
|
||||
}
|
||||
|
||||
func SetDefaults_HorizontalPodAutoscaler(obj *autoscalingv2beta2.HorizontalPodAutoscaler) {
|
||||
if obj.Spec.MinReplicas == nil {
|
||||
minReplicas := int32(1)
|
||||
obj.Spec.MinReplicas = &minReplicas
|
||||
}
|
||||
|
||||
if len(obj.Spec.Metrics) == 0 {
|
||||
utilizationDefaultVal := int32(autoscaling.DefaultCPUUtilization)
|
||||
obj.Spec.Metrics = []autoscalingv2beta2.MetricSpec{
|
||||
{
|
||||
Type: autoscalingv2beta2.ResourceMetricSourceType,
|
||||
Resource: &autoscalingv2beta2.ResourceMetricSource{
|
||||
Name: v1.ResourceCPU,
|
||||
Target: autoscalingv2beta2.MetricTarget{
|
||||
Type: autoscalingv2beta2.UtilizationMetricType,
|
||||
AverageUtilization: &utilizationDefaultVal,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
20
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/doc.go
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/doc.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
|
||||
package v2beta2 // import "k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2"
|
45
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/register.go
generated
vendored
Normal file
45
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/register.go
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = "autoscaling"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2beta2"}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
localSchemeBuilder = &autoscalingv2beta2.SchemeBuilder
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func init() {
|
||||
// We only register manually written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The separation
|
||||
// makes the code compile even when the generated files are missing.
|
||||
localSchemeBuilder.Register(addDefaultingFuncs)
|
||||
}
|
35
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/zz_generated.conversion.go
generated
vendored
Normal file
35
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/zz_generated.conversion.go
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by conversion-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
func init() {
|
||||
localSchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(s *runtime.Scheme) error {
|
||||
return nil
|
||||
}
|
32
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/zz_generated.defaults.go
generated
vendored
Normal file
32
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/v2beta2/zz_generated.defaults.go
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by defaulter-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
return nil
|
||||
}
|
13
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/validation/BUILD
generated
vendored
13
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/validation/BUILD
generated
vendored
@ -13,9 +13,10 @@ go_library(
|
||||
deps = [
|
||||
"//pkg/apis/autoscaling:go_default_library",
|
||||
"//pkg/apis/core/validation:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/validation/path:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/validation:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/validation/path:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@ -26,9 +27,9 @@ go_test(
|
||||
deps = [
|
||||
"//pkg/apis/autoscaling:go_default_library",
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//pkg/util/pointer:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/utils/pointer:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
113
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/validation/validation.go
generated
vendored
113
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/validation/validation.go
generated
vendored
@ -19,6 +19,7 @@ package validation
|
||||
import (
|
||||
"strings"
|
||||
|
||||
apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation"
|
||||
pathvalidation "k8s.io/apimachinery/pkg/api/validation/path"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
@ -28,7 +29,7 @@ import (
|
||||
|
||||
func ValidateScale(scale *autoscaling.Scale) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&scale.ObjectMeta, true, apivalidation.NameIsDNSSubdomain, field.NewPath("metadata"))...)
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&scale.ObjectMeta, true, apimachineryvalidation.NameIsDNSSubdomain, field.NewPath("metadata"))...)
|
||||
|
||||
if scale.Spec.Replicas < 0 {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "replicas"), scale.Spec.Replicas, "must be greater than or equal to 0"))
|
||||
@ -177,14 +178,16 @@ func validateMetricSpec(spec autoscaling.MetricSpec, fldPath *field.Path) field.
|
||||
func validateObjectSource(src *autoscaling.ObjectMetricSource, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
||||
allErrs = append(allErrs, ValidateCrossVersionObjectReference(src.Target, fldPath.Child("target"))...)
|
||||
|
||||
if len(src.MetricName) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("metricName"), "must specify a metric name"))
|
||||
allErrs = append(allErrs, ValidateCrossVersionObjectReference(src.DescribedObject, fldPath.Child("describedObject"))...)
|
||||
allErrs = append(allErrs, validateMetricIdentifier(src.Metric, fldPath.Child("metric"))...)
|
||||
if &src.Target == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("target"), "must specify a metric target"))
|
||||
} else {
|
||||
allErrs = append(allErrs, validateMetricTarget(src.Target, fldPath.Child("target"))...)
|
||||
}
|
||||
|
||||
if src.TargetValue.Sign() != 1 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("targetValue"), "must specify a positive target value"))
|
||||
if src.Target.Value == nil && src.Target.AverageValue == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("target").Child("averageValue"), "must set either a target value or averageValue"))
|
||||
}
|
||||
|
||||
return allErrs
|
||||
@ -193,28 +196,19 @@ func validateObjectSource(src *autoscaling.ObjectMetricSource, fldPath *field.Pa
|
||||
func validateExternalSource(src *autoscaling.ExternalMetricSource, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
||||
if len(src.MetricName) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("metricName"), "must specify a metric name"))
|
||||
allErrs = append(allErrs, validateMetricIdentifier(src.Metric, fldPath.Child("metric"))...)
|
||||
if &src.Target == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("target"), "must specify a metric target"))
|
||||
} else {
|
||||
for _, msg := range pathvalidation.IsValidPathSegmentName(src.MetricName) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("metricName"), src.MetricName, msg))
|
||||
}
|
||||
allErrs = append(allErrs, validateMetricTarget(src.Target, fldPath.Child("target"))...)
|
||||
}
|
||||
|
||||
if src.TargetValue == nil && src.TargetAverageValue == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("targetValue"), "must set either a target value for metric or a per-pod target"))
|
||||
if src.Target.Value == nil && src.Target.AverageValue == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("target").Child("averageValue"), "must set either a target value for metric or a per-pod target"))
|
||||
}
|
||||
|
||||
if src.TargetValue != nil && src.TargetAverageValue != nil {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("targetValue"), "may not set both a target value for metric and a per-pod target"))
|
||||
}
|
||||
|
||||
if src.TargetAverageValue != nil && src.TargetAverageValue.Sign() != 1 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("targetAverageValue"), src.TargetAverageValue, "must be positive"))
|
||||
}
|
||||
|
||||
if src.TargetValue != nil && src.TargetValue.Sign() != 1 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("targetValue"), src.TargetValue, "must be positive"))
|
||||
if src.Target.Value != nil && src.Target.AverageValue != nil {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("target").Child("value"), "may not set both a target value for metric and a per-pod target"))
|
||||
}
|
||||
|
||||
return allErrs
|
||||
@ -223,12 +217,15 @@ func validateExternalSource(src *autoscaling.ExternalMetricSource, fldPath *fiel
|
||||
func validatePodsSource(src *autoscaling.PodsMetricSource, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
||||
if len(src.MetricName) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("metricName"), "must specify a metric name"))
|
||||
allErrs = append(allErrs, validateMetricIdentifier(src.Metric, fldPath.Child("metric"))...)
|
||||
if &src.Target == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("target"), "must specify a metric target"))
|
||||
} else {
|
||||
allErrs = append(allErrs, validateMetricTarget(src.Target, fldPath.Child("target"))...)
|
||||
}
|
||||
|
||||
if src.TargetAverageValue.Sign() != 1 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("targetAverageValue"), "must specify a positive target value"))
|
||||
if src.Target.AverageValue == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("target").Child("averageValue"), "must specify a positive target averageValue"))
|
||||
}
|
||||
|
||||
return allErrs
|
||||
@ -240,22 +237,60 @@ func validateResourceSource(src *autoscaling.ResourceMetricSource, fldPath *fiel
|
||||
if len(src.Name) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("name"), "must specify a resource name"))
|
||||
}
|
||||
|
||||
if src.TargetAverageUtilization == nil && src.TargetAverageValue == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("targetAverageUtilization"), "must set either a target raw value or a target utilization"))
|
||||
if &src.Target == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("target"), "must specify a metric target"))
|
||||
} else {
|
||||
allErrs = append(allErrs, validateMetricTarget(src.Target, fldPath.Child("target"))...)
|
||||
}
|
||||
|
||||
if src.TargetAverageUtilization != nil && *src.TargetAverageUtilization < 1 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("targetAverageUtilization"), src.TargetAverageUtilization, "must be greater than 0"))
|
||||
if src.Target.AverageUtilization == nil && src.Target.AverageValue == nil {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("target").Child("averageUtilization"), "must set either a target raw value or a target utilization"))
|
||||
}
|
||||
|
||||
if src.TargetAverageUtilization != nil && src.TargetAverageValue != nil {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("targetAverageValue"), "may not set both a target raw value and a target utilization"))
|
||||
}
|
||||
|
||||
if src.TargetAverageValue != nil && src.TargetAverageValue.Sign() != 1 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("targetAverageValue"), src.TargetAverageValue, "must be positive"))
|
||||
if src.Target.AverageUtilization != nil && src.Target.AverageValue != nil {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("target").Child("averageValue"), "may not set both a target raw value and a target utilization"))
|
||||
}
|
||||
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func validateMetricTarget(mt autoscaling.MetricTarget, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
||||
if len(mt.Type) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("type"), "must specify a metric target type"))
|
||||
}
|
||||
|
||||
if mt.Type != autoscaling.UtilizationMetricType &&
|
||||
mt.Type != autoscaling.ValueMetricType &&
|
||||
mt.Type != autoscaling.AverageValueMetricType {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("type"), mt.Type, "must be either Utilization, Value, or AverageValue"))
|
||||
}
|
||||
|
||||
if mt.Value != nil && mt.Value.Sign() != 1 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("value"), mt.Value, "must be positive"))
|
||||
}
|
||||
|
||||
if mt.AverageValue != nil && mt.AverageValue.Sign() != 1 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("averageValue"), mt.AverageValue, "must be positive"))
|
||||
}
|
||||
|
||||
if mt.AverageUtilization != nil && *mt.AverageUtilization < 1 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("averageUtilization"), mt.AverageUtilization, "must be greater than 0"))
|
||||
}
|
||||
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func validateMetricIdentifier(id autoscaling.MetricIdentifier, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
||||
if len(id.Name) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("name"), "must specify a metric name"))
|
||||
} else {
|
||||
for _, msg := range pathvalidation.IsValidPathSegmentName(id.Name) {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), id.Name, msg))
|
||||
}
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
395
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/validation/validation_test.go
generated
vendored
395
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/validation/validation_test.go
generated
vendored
@ -24,7 +24,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
api "k8s.io/kubernetes/pkg/apis/core"
|
||||
utilpointer "k8s.io/kubernetes/pkg/util/pointer"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
func TestValidateScale(t *testing.T) {
|
||||
@ -92,6 +92,10 @@ func TestValidateScale(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
metricLabelSelector, err := metav1.ParseToLabelSelector("label=value")
|
||||
if err != nil {
|
||||
t.Errorf("unable to parse label selector: %v", err)
|
||||
}
|
||||
successCases := []autoscaling.HorizontalPodAutoscaler{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
@ -110,7 +114,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageUtilization: utilpointer.Int32Ptr(70),
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
AverageUtilization: utilpointer.Int32Ptr(70),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -146,8 +153,11 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
Name: api.ResourceCPU,
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.AverageValueMetricType,
|
||||
AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -169,8 +179,13 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.PodsMetricSourceType,
|
||||
Pods: &autoscaling.PodsMetricSource{
|
||||
MetricName: "somemetric",
|
||||
TargetAverageValue: *resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.AverageValueMetricType,
|
||||
AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -192,12 +207,17 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ObjectMetricSourceType,
|
||||
Object: &autoscaling.ObjectMetricSource{
|
||||
Target: autoscaling.CrossVersionObjectReference{
|
||||
DescribedObject: autoscaling.CrossVersionObjectReference{
|
||||
Kind: "ReplicationController",
|
||||
Name: "myrc",
|
||||
},
|
||||
MetricName: "somemetric",
|
||||
TargetValue: *resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -219,13 +239,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
MetricName: "somemetric",
|
||||
MetricSelector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
"label": "value",
|
||||
},
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
TargetValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -247,13 +268,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
MetricName: "somemetric",
|
||||
MetricSelector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
"label": "value",
|
||||
},
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.AverageValueMetricType,
|
||||
AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
TargetAverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -282,7 +304,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageUtilization: utilpointer.Int32Ptr(70),
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
AverageUtilization: utilpointer.Int32Ptr(70),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -302,7 +327,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageUtilization: utilpointer.Int32Ptr(70),
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
AverageUtilization: utilpointer.Int32Ptr(70),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -322,7 +350,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageUtilization: utilpointer.Int32Ptr(70),
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
AverageUtilization: utilpointer.Int32Ptr(70),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -342,7 +373,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageUtilization: utilpointer.Int32Ptr(70),
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
AverageUtilization: utilpointer.Int32Ptr(70),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -393,8 +427,11 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageUtilization: utilpointer.Int32Ptr(70),
|
||||
TargetAverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
AverageUtilization: utilpointer.Int32Ptr(70),
|
||||
AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -413,7 +450,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
TargetAverageUtilization: utilpointer.Int32Ptr(70),
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
AverageUtilization: utilpointer.Int32Ptr(70),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -433,7 +473,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageUtilization: utilpointer.Int32Ptr(-10),
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.UtilizationMetricType,
|
||||
AverageUtilization: utilpointer.Int32Ptr(-10),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -453,6 +496,9 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -471,7 +517,11 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.PodsMetricSourceType,
|
||||
Pods: &autoscaling.PodsMetricSource{
|
||||
TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
Metric: autoscaling.MetricIdentifier{},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -490,36 +540,18 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.PodsMetricSourceType,
|
||||
Pods: &autoscaling.PodsMetricSource{
|
||||
MetricName: "somemetric",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
msg: "must specify a positive target value",
|
||||
},
|
||||
{
|
||||
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
|
||||
Spec: autoscaling.HorizontalPodAutoscalerSpec{
|
||||
ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
|
||||
MinReplicas: utilpointer.Int32Ptr(1),
|
||||
MaxReplicas: 5,
|
||||
Metrics: []autoscaling.MetricSpec{
|
||||
{
|
||||
Type: autoscaling.ObjectMetricSourceType,
|
||||
Object: &autoscaling.ObjectMetricSource{
|
||||
Target: autoscaling.CrossVersionObjectReference{
|
||||
Name: "myrc",
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
},
|
||||
MetricName: "somemetric",
|
||||
TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
msg: "target.kind: Required",
|
||||
msg: "must specify a positive target averageValue",
|
||||
},
|
||||
{
|
||||
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
|
||||
@ -532,11 +564,70 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ObjectMetricSourceType,
|
||||
Object: &autoscaling.ObjectMetricSource{
|
||||
Target: autoscaling.CrossVersionObjectReference{
|
||||
DescribedObject: autoscaling.CrossVersionObjectReference{
|
||||
Kind: "ReplicationController",
|
||||
Name: "myrc",
|
||||
},
|
||||
TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
msg: "must set either a target value or averageValue",
|
||||
},
|
||||
{
|
||||
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
|
||||
Spec: autoscaling.HorizontalPodAutoscalerSpec{
|
||||
ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
|
||||
MinReplicas: utilpointer.Int32Ptr(1),
|
||||
MaxReplicas: 5,
|
||||
Metrics: []autoscaling.MetricSpec{
|
||||
{
|
||||
Type: autoscaling.ObjectMetricSourceType,
|
||||
Object: &autoscaling.ObjectMetricSource{
|
||||
DescribedObject: autoscaling.CrossVersionObjectReference{
|
||||
Name: "myrc",
|
||||
},
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
msg: "object.describedObject.kind: Required",
|
||||
},
|
||||
{
|
||||
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
|
||||
Spec: autoscaling.HorizontalPodAutoscalerSpec{
|
||||
ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
|
||||
MinReplicas: utilpointer.Int32Ptr(1),
|
||||
MaxReplicas: 5,
|
||||
Metrics: []autoscaling.MetricSpec{
|
||||
{
|
||||
Type: autoscaling.ObjectMetricSourceType,
|
||||
Object: &autoscaling.ObjectMetricSource{
|
||||
DescribedObject: autoscaling.CrossVersionObjectReference{
|
||||
Kind: "ReplicationController",
|
||||
Name: "myrc",
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -555,12 +646,13 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
MetricSelector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
"label": "value",
|
||||
},
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
TargetValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -579,13 +671,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
MetricName: "foo/../",
|
||||
MetricSelector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
"label": "value",
|
||||
},
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "foo/../",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
TargetValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -605,11 +698,12 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
MetricName: "somemetric",
|
||||
MetricSelector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
"label": "value",
|
||||
},
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -629,13 +723,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
MetricName: "somemetric",
|
||||
MetricSelector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
"label": "value",
|
||||
},
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: resource.NewMilliQuantity(-300, resource.DecimalSI),
|
||||
},
|
||||
TargetValue: resource.NewMilliQuantity(-300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -654,13 +749,14 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
MetricName: "somemetric",
|
||||
MetricSelector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
"label": "value",
|
||||
},
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
AverageValue: resource.NewMilliQuantity(-300, resource.DecimalSI),
|
||||
},
|
||||
TargetAverageValue: resource.NewMilliQuantity(-300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -679,14 +775,15 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
MetricName: "somemetric",
|
||||
MetricSelector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
"label": "value",
|
||||
},
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
AverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
TargetValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
TargetAverageValue: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -694,6 +791,79 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
},
|
||||
msg: "may not set both a target value for metric and a per-pod target",
|
||||
},
|
||||
{
|
||||
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
|
||||
Spec: autoscaling.HorizontalPodAutoscalerSpec{
|
||||
ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
|
||||
MinReplicas: utilpointer.Int32Ptr(1),
|
||||
MaxReplicas: 5,
|
||||
Metrics: []autoscaling.MetricSpec{
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: "boogity",
|
||||
Value: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
msg: "must be either Utilization, Value, or AverageValue",
|
||||
},
|
||||
{
|
||||
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
|
||||
Spec: autoscaling.HorizontalPodAutoscalerSpec{
|
||||
ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
|
||||
MinReplicas: utilpointer.Int32Ptr(1),
|
||||
MaxReplicas: 5,
|
||||
Metrics: []autoscaling.MetricSpec{
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Value: resource.NewMilliQuantity(300, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
msg: "must specify a metric target type",
|
||||
},
|
||||
{
|
||||
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
|
||||
Spec: autoscaling.HorizontalPodAutoscalerSpec{
|
||||
ScaleTargetRef: autoscaling.CrossVersionObjectReference{Name: "myrc", Kind: "ReplicationController"},
|
||||
MinReplicas: utilpointer.Int32Ptr(1),
|
||||
MaxReplicas: 5,
|
||||
Metrics: []autoscaling.MetricSpec{
|
||||
{
|
||||
Type: autoscaling.ExternalMetricSourceType,
|
||||
External: &autoscaling.ExternalMetricSource{
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
Selector: metricLabelSelector,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
msg: "must specify a metric target",
|
||||
},
|
||||
{
|
||||
horizontalPodAutoscaler: autoscaling.HorizontalPodAutoscaler{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "myautoscaler", Namespace: metav1.NamespaceDefault},
|
||||
@ -735,12 +905,20 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
{
|
||||
Type: autoscaling.ResourceMetricSourceType,
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
Name: api.ResourceCPU,
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.AverageValueMetricType,
|
||||
AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
Pods: &autoscaling.PodsMetricSource{
|
||||
MetricName: "somemetric",
|
||||
TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.AverageValueMetricType,
|
||||
AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -762,24 +940,37 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
sourceTypes := map[autoscaling.MetricSourceType]autoscaling.MetricSpec{
|
||||
autoscaling.ResourceMetricSourceType: {
|
||||
Resource: &autoscaling.ResourceMetricSource{
|
||||
Name: api.ResourceCPU,
|
||||
TargetAverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
Name: api.ResourceCPU,
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.AverageValueMetricType,
|
||||
AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
autoscaling.PodsMetricSourceType: {
|
||||
Pods: &autoscaling.PodsMetricSource{
|
||||
MetricName: "somemetric",
|
||||
TargetAverageValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.AverageValueMetricType,
|
||||
AverageValue: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
autoscaling.ObjectMetricSourceType: {
|
||||
Object: &autoscaling.ObjectMetricSource{
|
||||
Target: autoscaling.CrossVersionObjectReference{
|
||||
DescribedObject: autoscaling.CrossVersionObjectReference{
|
||||
Kind: "ReplicationController",
|
||||
Name: "myrc",
|
||||
},
|
||||
MetricName: "somemetric",
|
||||
TargetValue: *resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
Metric: autoscaling.MetricIdentifier{
|
||||
Name: "somemetric",
|
||||
},
|
||||
Target: autoscaling.MetricTarget{
|
||||
Type: autoscaling.ValueMetricType,
|
||||
Value: resource.NewMilliQuantity(100, resource.DecimalSI),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
265
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/zz_generated.deepcopy.go
generated
vendored
265
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/zz_generated.deepcopy.go
generated
vendored
@ -44,33 +44,8 @@ func (in *CrossVersionObjectReference) DeepCopy() *CrossVersionObjectReference {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ExternalMetricSource) DeepCopyInto(out *ExternalMetricSource) {
|
||||
*out = *in
|
||||
if in.MetricSelector != nil {
|
||||
in, out := &in.MetricSelector, &out.MetricSelector
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(v1.LabelSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
if in.TargetValue != nil {
|
||||
in, out := &in.TargetValue, &out.TargetValue
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
}
|
||||
if in.TargetAverageValue != nil {
|
||||
in, out := &in.TargetAverageValue, &out.TargetAverageValue
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
}
|
||||
in.Metric.DeepCopyInto(&out.Metric)
|
||||
in.Target.DeepCopyInto(&out.Target)
|
||||
return
|
||||
}
|
||||
|
||||
@ -87,25 +62,8 @@ func (in *ExternalMetricSource) DeepCopy() *ExternalMetricSource {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ExternalMetricStatus) DeepCopyInto(out *ExternalMetricStatus) {
|
||||
*out = *in
|
||||
if in.MetricSelector != nil {
|
||||
in, out := &in.MetricSelector, &out.MetricSelector
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(v1.LabelSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
out.CurrentValue = in.CurrentValue.DeepCopy()
|
||||
if in.CurrentAverageValue != nil {
|
||||
in, out := &in.CurrentAverageValue, &out.CurrentAverageValue
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
}
|
||||
in.Metric.DeepCopyInto(&out.Metric)
|
||||
in.Current.DeepCopyInto(&out.Current)
|
||||
return
|
||||
}
|
||||
|
||||
@ -203,12 +161,8 @@ func (in *HorizontalPodAutoscalerSpec) DeepCopyInto(out *HorizontalPodAutoscaler
|
||||
out.ScaleTargetRef = in.ScaleTargetRef
|
||||
if in.MinReplicas != nil {
|
||||
in, out := &in.MinReplicas, &out.MinReplicas
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.Metrics != nil {
|
||||
in, out := &in.Metrics, &out.Metrics
|
||||
@ -235,20 +189,12 @@ func (in *HorizontalPodAutoscalerStatus) DeepCopyInto(out *HorizontalPodAutoscal
|
||||
*out = *in
|
||||
if in.ObservedGeneration != nil {
|
||||
in, out := &in.ObservedGeneration, &out.ObservedGeneration
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(int64)
|
||||
**out = **in
|
||||
}
|
||||
*out = new(int64)
|
||||
**out = **in
|
||||
}
|
||||
if in.LastScaleTime != nil {
|
||||
in, out := &in.LastScaleTime, &out.LastScaleTime
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.CurrentMetrics != nil {
|
||||
in, out := &in.CurrentMetrics, &out.CurrentMetrics
|
||||
@ -277,44 +223,49 @@ func (in *HorizontalPodAutoscalerStatus) DeepCopy() *HorizontalPodAutoscalerStat
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricIdentifier) DeepCopyInto(out *MetricIdentifier) {
|
||||
*out = *in
|
||||
if in.Selector != nil {
|
||||
in, out := &in.Selector, &out.Selector
|
||||
*out = new(v1.LabelSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricIdentifier.
|
||||
func (in *MetricIdentifier) DeepCopy() *MetricIdentifier {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MetricIdentifier)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricSpec) DeepCopyInto(out *MetricSpec) {
|
||||
*out = *in
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(ObjectMetricSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
*out = new(ObjectMetricSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(PodsMetricSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
*out = new(PodsMetricSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(ResourceMetricSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
*out = new(ResourceMetricSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(ExternalMetricSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
*out = new(ExternalMetricSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -334,39 +285,23 @@ func (in *MetricStatus) DeepCopyInto(out *MetricStatus) {
|
||||
*out = *in
|
||||
if in.Object != nil {
|
||||
in, out := &in.Object, &out.Object
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(ObjectMetricStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
*out = new(ObjectMetricStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Pods != nil {
|
||||
in, out := &in.Pods, &out.Pods
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(PodsMetricStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
*out = new(PodsMetricStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Resource != nil {
|
||||
in, out := &in.Resource, &out.Resource
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(ResourceMetricStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
*out = new(ResourceMetricStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.External != nil {
|
||||
in, out := &in.External, &out.External
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(ExternalMetricStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
*out = new(ExternalMetricStatus)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -381,11 +316,74 @@ func (in *MetricStatus) DeepCopy() *MetricStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricTarget) DeepCopyInto(out *MetricTarget) {
|
||||
*out = *in
|
||||
if in.Value != nil {
|
||||
in, out := &in.Value, &out.Value
|
||||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
if in.AverageValue != nil {
|
||||
in, out := &in.AverageValue, &out.AverageValue
|
||||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
if in.AverageUtilization != nil {
|
||||
in, out := &in.AverageUtilization, &out.AverageUtilization
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricTarget.
|
||||
func (in *MetricTarget) DeepCopy() *MetricTarget {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MetricTarget)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricValueStatus) DeepCopyInto(out *MetricValueStatus) {
|
||||
*out = *in
|
||||
if in.Value != nil {
|
||||
in, out := &in.Value, &out.Value
|
||||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
if in.AverageValue != nil {
|
||||
in, out := &in.AverageValue, &out.AverageValue
|
||||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
if in.AverageUtilization != nil {
|
||||
in, out := &in.AverageUtilization, &out.AverageUtilization
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricValueStatus.
|
||||
func (in *MetricValueStatus) DeepCopy() *MetricValueStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MetricValueStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ObjectMetricSource) DeepCopyInto(out *ObjectMetricSource) {
|
||||
*out = *in
|
||||
out.Target = in.Target
|
||||
out.TargetValue = in.TargetValue.DeepCopy()
|
||||
out.DescribedObject = in.DescribedObject
|
||||
in.Target.DeepCopyInto(&out.Target)
|
||||
in.Metric.DeepCopyInto(&out.Metric)
|
||||
return
|
||||
}
|
||||
|
||||
@ -402,8 +400,9 @@ func (in *ObjectMetricSource) DeepCopy() *ObjectMetricSource {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ObjectMetricStatus) DeepCopyInto(out *ObjectMetricStatus) {
|
||||
*out = *in
|
||||
out.Target = in.Target
|
||||
out.CurrentValue = in.CurrentValue.DeepCopy()
|
||||
in.Metric.DeepCopyInto(&out.Metric)
|
||||
in.Current.DeepCopyInto(&out.Current)
|
||||
out.DescribedObject = in.DescribedObject
|
||||
return
|
||||
}
|
||||
|
||||
@ -420,7 +419,8 @@ func (in *ObjectMetricStatus) DeepCopy() *ObjectMetricStatus {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PodsMetricSource) DeepCopyInto(out *PodsMetricSource) {
|
||||
*out = *in
|
||||
out.TargetAverageValue = in.TargetAverageValue.DeepCopy()
|
||||
in.Metric.DeepCopyInto(&out.Metric)
|
||||
in.Target.DeepCopyInto(&out.Target)
|
||||
return
|
||||
}
|
||||
|
||||
@ -437,7 +437,8 @@ func (in *PodsMetricSource) DeepCopy() *PodsMetricSource {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PodsMetricStatus) DeepCopyInto(out *PodsMetricStatus) {
|
||||
*out = *in
|
||||
out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy()
|
||||
in.Metric.DeepCopyInto(&out.Metric)
|
||||
in.Current.DeepCopyInto(&out.Current)
|
||||
return
|
||||
}
|
||||
|
||||
@ -454,24 +455,7 @@ func (in *PodsMetricStatus) DeepCopy() *PodsMetricStatus {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourceMetricSource) DeepCopyInto(out *ResourceMetricSource) {
|
||||
*out = *in
|
||||
if in.TargetAverageUtilization != nil {
|
||||
in, out := &in.TargetAverageUtilization, &out.TargetAverageUtilization
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.TargetAverageValue != nil {
|
||||
in, out := &in.TargetAverageValue, &out.TargetAverageValue
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
}
|
||||
in.Target.DeepCopyInto(&out.Target)
|
||||
return
|
||||
}
|
||||
|
||||
@ -488,16 +472,7 @@ func (in *ResourceMetricSource) DeepCopy() *ResourceMetricSource {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourceMetricStatus) DeepCopyInto(out *ResourceMetricStatus) {
|
||||
*out = *in
|
||||
if in.CurrentAverageUtilization != nil {
|
||||
in, out := &in.CurrentAverageUtilization, &out.CurrentAverageUtilization
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
out.CurrentAverageValue = in.CurrentAverageValue.DeepCopy()
|
||||
in.Current.DeepCopyInto(&out.Current)
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user