Merge pull request #46761 from yastij/syncService-remove-copy

Automatic merge from submit-queue (batch tested with PRs 48106, 46761)

removing unnecessary shallow copy on SyncService

**What this PR does / why we need it**: remove shallow copy + avoid using same index name as the nested loop

**Which issue this PR fixes**: fixes #46703 

**Special notes for your reviewer**:

**Release note**:

```release-note
```
This commit is contained in:
Kubernetes Submit Queue 2017-06-27 15:02:00 -07:00 committed by GitHub
commit c30f5e1d3c

View File

@ -368,9 +368,7 @@ func (e *EndpointController) syncService(key string) error {
readyEps := 0 readyEps := 0
notReadyEps := 0 notReadyEps := 0
for i := range pods { for _, pod := range pods {
// TODO: Do we need to copy here?
pod := &(*pods[i])
for i := range service.Spec.Ports { for i := range service.Spec.Ports {
servicePort := &service.Spec.Ports[i] servicePort := &service.Spec.Ports[i]