Skip to content

Commit

Permalink
Merge branch 'master' into fix_traefik_io_resource_name
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoTarijon authored Jul 31, 2024
2 parents a253778 + 6c873a9 commit dd369bc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/kubectl-argo-rollouts/info/pod_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ func newPodInfo(pod *corev1.Pod) rollout.PodInfo {
},
}
restarts := 0
rs := make(map[string]bool, len(pod.Spec.InitContainers))
for _, c := range pod.Spec.InitContainers {
p := c.RestartPolicy
rs[c.Name] = p != nil && *p == corev1.ContainerRestartPolicyAlways
}

totalContainers := len(pod.Spec.Containers)
readyContainers := 0

Expand All @@ -69,7 +75,7 @@ func newPodInfo(pod *corev1.Pod) rollout.PodInfo {
continue
case container.State.Terminated != nil:
// initialization is failed
if len(container.State.Terminated.Reason) == 0 {
if container.State.Terminated.Reason == "" {
if container.State.Terminated.Signal != 0 {
reason = fmt.Sprintf("Init:Signal:%d", container.State.Terminated.Signal)
} else {
Expand All @@ -79,6 +85,10 @@ func newPodInfo(pod *corev1.Pod) rollout.PodInfo {
reason = "Init:" + container.State.Terminated.Reason
}
initializing = true
case rs[container.Name] && container.Started != nil && *container.Started:
if container.Ready {
continue
}
case container.State.Waiting != nil && len(container.State.Waiting.Reason) > 0 && container.State.Waiting.Reason != "PodInitializing":
reason = "Init:" + container.State.Waiting.Reason
initializing = true
Expand Down

0 comments on commit dd369bc

Please sign in to comment.