Migrate HPA v1 to v2beta2 (#2421)
* Migrate HPA v1 to v2beta2 HPA v2beta2 is defined and supported from 1.19+ onwards. Also HPA v2 is stable from 1.23 onwards. As we support 1.19+ onwards using HPA v2beta2. This change is base for custom metrics support we want to add later by modifying Function spec. * Add unit tests for hpa operations * Use constants instead of strings Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -6,7 +6,8 @@ import (
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
asv1 "k8s.io/api/autoscaling/v1"
|
||||
asv2beta2 "k8s.io/api/autoscaling/v2beta2"
|
||||
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
@@ -74,7 +75,7 @@ func GetAttributesForDeployment(deployment *appsv1.Deployment) []attribute.KeyVa
|
||||
}
|
||||
}
|
||||
|
||||
func GetAttributesForHPA(hpa *asv1.HorizontalPodAutoscaler) []attribute.KeyValue {
|
||||
func GetAttributesForHPA(hpa *asv2beta2.HorizontalPodAutoscaler) []attribute.KeyValue {
|
||||
if hpa == nil {
|
||||
return []attribute.KeyValue{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user