Skip to content

Commit

Permalink
Update deps for Kubernetes 1.8
Browse files Browse the repository at this point in the history
This updates the dependencies to be compatible with Kubernetes 1.8,
including the new custom.metrics.k8s.io/v1beta1 API group and the
corresponding custom-metrics-apiserver changes.
  • Loading branch information
DirectXMan12 committed Sep 28, 2017
1 parent cc94ef4 commit 43bd479
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 92 deletions.
6 changes: 3 additions & 3 deletions cmd/adapter/app/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"time"

"github.com/spf13/cobra"
apimeta "k8s.io/apimachinery/pkg/api/meta"
"k8s.io/client-go/discovery"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"

Expand Down Expand Up @@ -112,7 +112,7 @@ func (o PrometheusAdapterServerOptions) RunCustomMetricsAdapterServer(stopCh <-c
return fmt.Errorf("unable to construct discovery client for dynamic client: %v", err)
}

dynamicMapper, err := dynamicmapper.NewRESTMapper(discoveryClient, api.Registry.InterfacesFor, o.DiscoveryInterval)
dynamicMapper, err := dynamicmapper.NewRESTMapper(discoveryClient, apimeta.InterfacesForUnstructured, o.DiscoveryInterval)
if err != nil {
return fmt.Errorf("unable to construct dynamic discovery mapper: %v", err)
}
Expand All @@ -133,7 +133,7 @@ func (o PrometheusAdapterServerOptions) RunCustomMetricsAdapterServer(stopCh <-c

cmProvider := cmprov.NewPrometheusProvider(dynamicMapper, clientPool, promClient, o.MetricsRelistInterval, o.RateInterval, stopCh)

server, err := config.Complete().New(cmProvider)
server, err := config.Complete().New("prometheus-custom-metrics-adapter", cmProvider)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit 43bd479

Please sign in to comment.