mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 01:38:10 +00:00
Update deps for Kubernetes 1.8
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.
This commit is contained in:
parent
cc94ef4068
commit
43bd4798b5
6 changed files with 155 additions and 92 deletions
|
|
@ -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"
|
||||
|
||||
|
|
@ -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)
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue