Merge pull request #73944 from xiaoanyunfei/cleanup/rm_unuse_judge
rm unnecessary judgement
This commit is contained in:
@@ -638,7 +638,7 @@ func (m *kubeGenericRuntimeManager) pruneInitContainersBeforeStart(pod *v1.Pod,
|
||||
for name := range initContainerNames {
|
||||
count := 0
|
||||
for _, status := range podStatus.ContainerStatuses {
|
||||
if status.Name != name || !initContainerNames.Has(status.Name) ||
|
||||
if status.Name != name ||
|
||||
(status.State != kubecontainer.ContainerStateExited &&
|
||||
status.State != kubecontainer.ContainerStateUnknown) {
|
||||
continue
|
||||
@@ -679,7 +679,7 @@ func (m *kubeGenericRuntimeManager) purgeInitContainers(pod *v1.Pod, podStatus *
|
||||
for name := range initContainerNames {
|
||||
count := 0
|
||||
for _, status := range podStatus.ContainerStatuses {
|
||||
if status.Name != name || !initContainerNames.Has(status.Name) {
|
||||
if status.Name != name {
|
||||
continue
|
||||
}
|
||||
count++
|
||||
|
Reference in New Issue
Block a user