Merge pull request #33474 from wojtek-t/user_agent_for_master_election

Automatic merge from submit-queue

Set UserAgent in LeaderElection clients.

Ref https://github.com/kubernetes/kubernetes/issues/33259

@timothysc - FYI
This commit is contained in:
Kubernetes Submit Queue
2016-09-27 22:58:08 -07:00
committed by GitHub
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() {