File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,10 @@ func GetPodTerminateMessage(pod *corev1api.Pod) string {
184184 }
185185 }
186186
187+ if pod .Status .Message != "" {
188+ message += pod .Status .Message + "/"
189+ }
190+
187191 return message
188192}
189193
Original file line number Diff line number Diff line change @@ -520,6 +520,27 @@ func TestGetPodTerminateMessage(t *testing.T) {
520520 },
521521 message : "message-1/message-2/message-3/" ,
522522 },
523+ {
524+ name : "with pod status message" ,
525+ pod : & corev1api.Pod {
526+ Status : corev1api.PodStatus {
527+ Message : "pod-message" ,
528+ },
529+ },
530+ message : "pod-message/" ,
531+ },
532+ {
533+ name : "with termination and pod status message" ,
534+ pod : & corev1api.Pod {
535+ Status : corev1api.PodStatus {
536+ ContainerStatuses : []corev1api.ContainerStatus {
537+ {Name : "container-1" , State : corev1api.ContainerState {Terminated : & corev1api.ContainerStateTerminated {Message : "message-1" }}},
538+ },
539+ Message : "pod-message" ,
540+ },
541+ },
542+ message : "message-1/pod-message/" ,
543+ },
523544 }
524545
525546 for _ , test := range tests {
You can’t perform that action at this time.
0 commit comments