Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
akodali18 committed Mar 20, 2024
1 parent 193d47c commit ee55535
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/provider/hpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package provider

import (
"k8s.io/api/autoscaling/v2beta2"
"reflect"
"strings"

Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit ee55535

Please sign in to comment.