File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
pkg/kubectl-argo-rollouts/info Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ func newPodInfo(pod *corev1.Pod) rollout.PodInfo {
5353 },
5454 }
5555 restarts := 0
56+ rs := make (map [string ]bool , len (pod .Spec .InitContainers ))
57+ for _ , c := range pod .Spec .InitContainers {
58+ p := c .RestartPolicy
59+ rs [c .Name ] = p != nil && * p == corev1 .ContainerRestartPolicyAlways
60+ }
61+
5662 totalContainers := len (pod .Spec .Containers )
5763 readyContainers := 0
5864
@@ -69,7 +75,7 @@ func newPodInfo(pod *corev1.Pod) rollout.PodInfo {
6975 continue
7076 case container .State .Terminated != nil :
7177 // initialization is failed
72- if len ( container .State .Terminated .Reason ) == 0 {
78+ if container .State .Terminated .Reason == "" {
7379 if container .State .Terminated .Signal != 0 {
7480 reason = fmt .Sprintf ("Init:Signal:%d" , container .State .Terminated .Signal )
7581 } else {
@@ -79,6 +85,10 @@ func newPodInfo(pod *corev1.Pod) rollout.PodInfo {
7985 reason = "Init:" + container .State .Terminated .Reason
8086 }
8187 initializing = true
88+ case rs [container .Name ] && container .Started != nil && * container .Started :
89+ if container .Ready {
90+ continue
91+ }
8292 case container .State .Waiting != nil && len (container .State .Waiting .Reason ) > 0 && container .State .Waiting .Reason != "PodInitializing" :
8393 reason = "Init:" + container .State .Waiting .Reason
8494 initializing = true
You can’t perform that action at this time.
0 commit comments