Skip to content

Commit

Permalink
fix(controller): fix pod with sidercar state
Browse files Browse the repository at this point in the history
Signed-off-by: linghaoSu <[email protected]>
  • Loading branch information
linghaoSu committed Sep 9, 2024
1 parent aa14f76 commit 020c9de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controller/cache/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ func populatePodInfo(un *unstructured.Unstructured, res *ResourceInfo) {
for i := range pod.Status.InitContainerStatuses {
container := pod.Status.InitContainerStatuses[i]
restarts += int(container.RestartCount)
containerSpec := pod.Spec.InitContainers[i]
switch {
case container.State.Terminated == nil && *containerSpec.RestartPolicy == v1.ContainerRestartPolicyAlways:
case container.State.Terminated != nil && container.State.Terminated.ExitCode == 0:
continue
case container.State.Terminated != nil:
Expand Down

0 comments on commit 020c9de

Please sign in to comment.