Update the Kubernetes autoscaling API to v2 (#2722) (#2842)

* Update the Kubernetes autoscaling API to v2 (#2722)
  - k8s.io/api/autoscaling/v2
* generate all files
* fix missing v2beta ref

---------

Signed-off-by: Lunik <lunik@tiwabbit.fr>
This commit is contained in:
Guillaume MARTINEZ
2023-10-11 11:04:45 +05:30
committed by GitHub
parent b43b31884a
commit 3762ff80f2
10 changed files with 52 additions and 51 deletions
+3 -3
View File
@@ -17,7 +17,7 @@ limitations under the License.
package v1
import (
asv2beta2 "k8s.io/api/autoscaling/v2beta2"
asv2 "k8s.io/api/autoscaling/v2"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@@ -475,12 +475,12 @@ type (
// created for the function.
// Applicable for executor type newdeploy and container.
// +optional
Metrics []asv2beta2.MetricSpec `json:"hpaMetrics,omitempty"`
Metrics []asv2.MetricSpec `json:"hpaMetrics,omitempty"`
// hpaBehavior is the behavior of HPA when scaling in up/down direction.
// Applicable for executor type newdeploy and container.
// +optional
Behavior *asv2beta2.HorizontalPodAutoscalerBehavior `json:"hpaBehavior,omitempty"`
Behavior *asv2.HorizontalPodAutoscalerBehavior `json:"hpaBehavior,omitempty"`
}
// FunctionReferenceType refers to type of Function
+3 -3
View File
@@ -21,7 +21,7 @@ limitations under the License.
package v1
import (
"k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/autoscaling/v2"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
)
@@ -302,14 +302,14 @@ func (in *ExecutionStrategy) DeepCopyInto(out *ExecutionStrategy) {
*out = *in
if in.Metrics != nil {
in, out := &in.Metrics, &out.Metrics
*out = make([]v2beta2.MetricSpec, len(*in))
*out = make([]v2.MetricSpec, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Behavior != nil {
in, out := &in.Behavior, &out.Behavior
*out = new(v2beta2.HorizontalPodAutoscalerBehavior)
*out = new(v2.HorizontalPodAutoscalerBehavior)
(*in).DeepCopyInto(*out)
}
}