improve performance

This commit is contained in:
lixiaobing1 2022-11-29 16:02:47 +08:00
parent 7061704297
commit fb327ddd15

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
} }
} }
} }