From ee55535a117fb193e7f179d7f254a3f68c8f0fa7 Mon Sep 17 00:00:00 2001 From: Anil Kodali Date: Tue, 19 Mar 2024 18:44:00 -0700 Subject: [PATCH] Fix imports --- pkg/provider/hpa.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/provider/hpa.go b/pkg/provider/hpa.go index e73bb0c..9ec5f72 100644 --- a/pkg/provider/hpa.go +++ b/pkg/provider/hpa.go @@ -4,6 +4,7 @@ package provider import ( + "k8s.io/api/autoscaling/v2beta2" "reflect" "strings" @@ -46,15 +47,15 @@ func (l *hpaListener) listen() { inf.AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { - hpa := obj.(*v2beta1.HorizontalPodAutoscaler) + hpa := obj.(*v2beta2.HorizontalPodAutoscaler) rules := rulesFromAnnotations(hpa.Annotations) if len(rules) > 0 { l.addFunc(rules) } }, UpdateFunc: func(oldObj, newObj interface{}) { - oldHPA := oldObj.(*v2beta1.HorizontalPodAutoscaler) - newHPA := newObj.(*v2beta1.HorizontalPodAutoscaler) + oldHPA := oldObj.(*v2beta2.HorizontalPodAutoscaler) + newHPA := newObj.(*v2beta2.HorizontalPodAutoscaler) // HPA objects are updated frequently when status changes // validate if annotations have changed @@ -73,7 +74,7 @@ func (l *hpaListener) listen() { } }, DeleteFunc: func(obj interface{}) { - hpa := obj.(*v2beta1.HorizontalPodAutoscaler) + hpa := obj.(*v2beta2.HorizontalPodAutoscaler) rules := rulesFromAnnotations(hpa.Annotations) if len(rules) > 0 { l.deleteFunc(rules)