mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +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 {
|
for name := range initContainerNames {
|
||||||
count := 0
|
count := 0
|
||||||
for _, status := range podStatus.ContainerStatuses {
|
for _, status := range podStatus.ContainerStatuses {
|
||||||
if status.Name != name || !initContainerNames.Has(status.Name) ||
|
if status.Name != name ||
|
||||||
(status.State != kubecontainer.ContainerStateExited &&
|
(status.State != kubecontainer.ContainerStateExited &&
|
||||||
status.State != kubecontainer.ContainerStateUnknown) {
|
status.State != kubecontainer.ContainerStateUnknown) {
|
||||||
continue
|
continue
|
||||||
@ -679,7 +679,7 @@ func (m *kubeGenericRuntimeManager) purgeInitContainers(pod *v1.Pod, podStatus *
|
|||||||
for name := range initContainerNames {
|
for name := range initContainerNames {
|
||||||
count := 0
|
count := 0
|
||||||
for _, status := range podStatus.ContainerStatuses {
|
for _, status := range podStatus.ContainerStatuses {
|
||||||
if status.Name != name || !initContainerNames.Has(status.Name) {
|
if status.Name != name {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
count++
|
count++
|
||||||
|
Loading…
Reference in New Issue
Block a user