Merge pull request #39838 from foxyriver/add-break

Automatic merge from submit-queue

break from the for loop

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

exit loop, because the following actions will not affect the result

**Special notes for your reviewer**:

**Release note**:

```release-note
```
This commit is contained in:
Kubernetes Submit Queue 2017-01-13 11:43:48 -08:00 committed by GitHub
commit 7dd815221c

View File

@ -469,12 +469,14 @@ func (s *Server) getContainerLogs(request *restful.Request, response *restful.Re
for _, container := range pod.Spec.Containers {
if container.Name == containerName {
containerExists = true
break
}
}
if !containerExists {
for _, container := range pod.Spec.InitContainers {
if container.Name == containerName {
containerExists = true
break
}
}
}