Merge pull request #53487 from oracle/for/upstream/master/service-event-logging

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Enable event logging in the service controller

**What this PR does / why we need it**:

This PR enables logging for the events in the service controller which keeps parity with the [node controller](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/cloud/node_controller.go#L83).

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #53528 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/cc @luxas @wlan0 @jhorwit2
pull/6/head
Kubernetes Submit Queue 2017-10-06 09:56:19 -07:00 committed by GitHub
commit 182aa93be8
1 changed files with 1 additions and 0 deletions

View File

@ -107,6 +107,7 @@ func New(
broadcaster := record.NewBroadcaster()
broadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: v1core.New(kubeClient.Core().RESTClient()).Events("")})
recorder := broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "service-controller"})
broadcaster.StartLogging(glog.Infof)
if kubeClient != nil && kubeClient.Core().RESTClient().GetRateLimiter() != nil {
metrics.RegisterMetricAndTrackRateLimiterUsage("service_controller", kubeClient.Core().RESTClient().GetRateLimiter())