mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #73944 from xiaoanyunfei/cleanup/rm_unuse_judge
rm unnecessary judgement
This commit is contained in:
commit
da986c56ab
@ -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++
|
||||
|
Loading…
Reference in New Issue
Block a user