Set UserAgent in LeaderElection clients.

This commit is contained in:
Wojciech Tyczynski
2016-09-26 09:46:59 +02:00
parent c19e08ebbc
commit cbcce2c90f
4 changed files with 51 additions and 49 deletions

View File

@@ -138,6 +138,7 @@ func Run(s *options.CMServer) error {
if err != nil {
glog.Fatalf("Invalid API configuration: %v", err)
}
leaderElectionClient := clientset.NewForConfigOrDie(restclient.AddUserAgent(kubeconfig, "leader-election"))
go func() {
mux := http.NewServeMux()
@@ -183,12 +184,12 @@ func Run(s *options.CMServer) error {
Namespace: "kube-system",
Name: "kube-controller-manager",
},
EndpointsClient: kubeClient,
Identity: id,
EventRecorder: recorder,
LeaseDuration: s.LeaderElection.LeaseDuration.Duration,
RenewDeadline: s.LeaderElection.RenewDeadline.Duration,
RetryPeriod: s.LeaderElection.RetryPeriod.Duration,
Client: leaderElectionClient,
Identity: id,
EventRecorder: recorder,
LeaseDuration: s.LeaderElection.LeaseDuration.Duration,
RenewDeadline: s.LeaderElection.RenewDeadline.Duration,
RetryPeriod: s.LeaderElection.RetryPeriod.Duration,
Callbacks: leaderelection.LeaderCallbacks{
OnStartedLeading: run,
OnStoppedLeading: func() {