...
1 package k8s
2
3 import (
4 l5dcrdclient "github.com/linkerd/linkerd2/controller/gen/client/clientset/versioned"
5 "github.com/linkerd/linkerd2/pkg/prometheus"
6 "k8s.io/client-go/rest"
7
8
9 _ "k8s.io/client-go/plugin/pkg/client/auth"
10 )
11
12 func wrapTransport(config *rest.Config, telemetryName string) *rest.Config {
13 wt := config.WrapTransport
14 config.WrapTransport = prometheus.ClientWithTelemetry(telemetryName, wt)
15 return config
16 }
17
18
19
20 func NewL5DCRDClient(kubeConfig *rest.Config) (*l5dcrdclient.Clientset, error) {
21 return l5dcrdclient.NewForConfig(wrapTransport(kubeConfig, "l5dCrd"))
22 }
23
View as plain text