break from the for loop

pull/6/head
foxyriver 2017-01-13 09:34:31 +08:00
parent e7537a21d9
commit b35dc8ecd7
1 changed files with 2 additions and 0 deletions

View File

@ -479,12 +479,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
}
}
}