Merge pull request #114179 from lixiaobing1/break

improve performance
This commit is contained in:
Kubernetes Prow Robot
2023-01-31 21:01:06 -08:00
committed by GitHub

View File

@@ -937,12 +937,14 @@ func (s *Server) checkpoint(request *restful.Request, response *restful.Response
for _, container := range pod.Spec.Containers { for _, container := range pod.Spec.Containers {
if container.Name == containerName { if container.Name == containerName {
found = true found = true
break
} }
} }
if !found { if !found {
for _, container := range pod.Spec.InitContainers { for _, container := range pod.Spec.InitContainers {
if container.Name == containerName { if container.Name == containerName {
found = true found = true
break
} }
} }
} }
@@ -950,6 +952,7 @@ func (s *Server) checkpoint(request *restful.Request, response *restful.Response
for _, container := range pod.Spec.EphemeralContainers { for _, container := range pod.Spec.EphemeralContainers {
if container.Name == containerName { if container.Name == containerName {
found = true found = true
break
} }
} }
} }