Skip to content

Commit

Permalink
Merge pull request flant#18 from anoopwebs/support-for-autoscaling-event
Browse files Browse the repository at this point in the history
add autoscaling kind
  • Loading branch information
diafour authored Jun 5, 2019
2 parents 4bbafba + 86fb4b3 commit 1ca99fd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/kube_events_manager/kube_events_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
appsV1 "k8s.io/client-go/informers/apps/v1"
autoscalingV2beta1 "k8s.io/client-go/informers/autoscaling/v2beta1"
batchV1 "k8s.io/client-go/informers/batch/v1"
batchV2Alpha1 "k8s.io/client-go/informers/batch/v2alpha1"
coreV1 "k8s.io/client-go/informers/core/v1"
Expand Down Expand Up @@ -235,6 +236,10 @@ func (em *MainKubeEventsManager) addKubeEventsInformer(kind, namespace string, l
sharedInformer = coreV1.NewFilteredServiceAccountInformer(kube.Kubernetes, namespace, resyncPeriod, indexers, tweakListOptions)
resourceList, err = kube.Kubernetes.CoreV1().ServiceAccounts(namespace).List(listOptions)

case "autoscaling":
sharedInformer = autoscalingV2beta1.NewFilteredHorizontalPodAutoscalerInformer(kube.Kubernetes, namespace, resyncPeriod, indexers, tweakListOptions)
resourceList, err = kube.Kubernetes.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).List(listOptions)

default:
return nil, fmt.Errorf("kind '%s' isn't supported", kind)
}
Expand Down

0 comments on commit 1ca99fd

Please sign in to comment.