fix hpa stale imports

This commit is contained in:
Andy Xie 2017-10-24 10:36:22 +08:00
parent 0e96be106a
commit 374607b8dd
2 changed files with 4 additions and 4 deletions

View File

@ -21,9 +21,9 @@ import (
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
autoscaling "k8s.io/api/autoscaling/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api"
autoscaling "k8s.io/client-go/pkg/apis/autoscaling/v1"
"k8s.io/client-go/tools/cache"
)
@ -72,7 +72,7 @@ func (l HPALister) List() (autoscaling.HorizontalPodAutoscalerList, error) {
func RegisterHorizontalPodAutoScalerCollector(registry prometheus.Registerer, kubeClient kubernetes.Interface, namespace string) {
client := kubeClient.Autoscaling().RESTClient()
hpalw := cache.NewListWatchFromClient(client, "horizontalpodautoscalers", api.NamespaceAll, nil)
hpalw := cache.NewListWatchFromClient(client, "horizontalpodautoscalers", metav1.NamespaceAll, nil)
hpainf := cache.NewSharedInformer(hpalw, &autoscaling.HorizontalPodAutoscaler{}, resyncPeriod)
hpaLister := HPALister(func() (hpas autoscaling.HorizontalPodAutoscalerList, err error) {

View File

@ -19,8 +19,8 @@ package collectors
import (
"testing"
autoscaling "k8s.io/api/autoscaling/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
autoscaling "k8s.io/client-go/pkg/apis/autoscaling/v1"
)
var (