...

Source file src/github.com/linkerd/linkerd2/controller/k8s/clientset.go

Documentation: github.com/linkerd/linkerd2/controller/k8s

     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  	// Load all the auth plugins for the cloud providers.
     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  // NewL5DCRDClient returns a Linkerd controller client for the given
    19  // configuration.
    20  func NewL5DCRDClient(kubeConfig *rest.Config) (*l5dcrdclient.Clientset, error) {
    21  	return l5dcrdclient.NewForConfig(wrapTransport(kubeConfig, "l5dCrd"))
    22  }
    23  

View as plain text