hpa: remove v2beta2 support

autoscaling/v2beta2 has been deprecated since [kubernetes 1.26](https://kubernetes.io/docs/reference/using-api/deprecation-guide/#horizontalpodautoscaler-v126) and been [removed for kubernetes 1.36](https://github.com/kubernetes/kubernetes/pull/135615)
This commit removes the hpa fallback to v2beta2 if v2 did not work

Signed-off-by: Niklas Ott <niklas.ott@unwired.at>
This commit is contained in:
Niklas Ott
2026-05-21 11:13:46 +02:00
parent f5cccbf197
commit af2436ef1d
9 changed files with 14 additions and 221 deletions
@@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap"
appsv1 "k8s.io/api/apps/v1"
hpav2 "k8s.io/api/autoscaling/v2beta2"
hpav2 "k8s.io/api/autoscaling/v2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
@@ -300,7 +300,7 @@ func newDeploymentTestCanary() *flaggerv1.Canary {
},
AutoscalerRef: &flaggerv1.AutoscalerReference{
Name: "podinfo",
APIVersion: "autoscaling/v2beta2",
APIVersion: "autoscaling/v2",
Kind: "HorizontalPodAutoscaler",
}, Service: flaggerv1.CanaryService{
Port: 9898,
@@ -362,7 +362,7 @@ func newDeploymentTestCanaryAB() *flaggerv1.Canary {
},
AutoscalerRef: &flaggerv1.AutoscalerReference{
Name: "podinfo",
APIVersion: "autoscaling/v2beta2",
APIVersion: "autoscaling/v2",
Kind: "HorizontalPodAutoscaler",
}, Service: flaggerv1.CanaryService{
Port: 9898,