@@ -1064,7 +1064,7 @@ func TestPrintPod(t *testing.T) {
1064
1064
[]metav1.TableRow {{Cells : []interface {}{"test5" , "1/2" , "podReason" , int64 (6 ), "<unknown>" }}},
1065
1065
},
1066
1066
{
1067
- // Test pod has 2 containers, one is running and the other is completed.
1067
+ // Test pod has 2 containers, one is running and the other is completed, w/o ready condition
1068
1068
api.Pod {
1069
1069
ObjectMeta : metav1.ObjectMeta {Name : "test6" },
1070
1070
Spec : api.PodSpec {Containers : make ([]api.Container , 2 )},
@@ -1077,6 +1077,25 @@ func TestPrintPod(t *testing.T) {
1077
1077
},
1078
1078
},
1079
1079
},
1080
+ []metav1.TableRow {{Cells : []interface {}{"test6" , "1/2" , "NotReady" , int64 (6 ), "<unknown>" }}},
1081
+ },
1082
+ {
1083
+ // Test pod has 2 containers, one is running and the other is completed, with ready condition
1084
+ api.Pod {
1085
+ ObjectMeta : metav1.ObjectMeta {Name : "test6" },
1086
+ Spec : api.PodSpec {Containers : make ([]api.Container , 2 )},
1087
+ Status : api.PodStatus {
1088
+ Phase : "Running" ,
1089
+ Reason : "" ,
1090
+ ContainerStatuses : []api.ContainerStatus {
1091
+ {Ready : true , RestartCount : 3 , State : api.ContainerState {Terminated : & api.ContainerStateTerminated {Reason : "Completed" , ExitCode : 0 }}},
1092
+ {Ready : true , RestartCount : 3 , State : api.ContainerState {Running : & api.ContainerStateRunning {}}},
1093
+ },
1094
+ Conditions : []api.PodCondition {
1095
+ {Type : api .PodReady , Status : api .ConditionTrue , LastProbeTime : metav1.Time {Time : time .Now ()}},
1096
+ },
1097
+ },
1098
+ },
1080
1099
[]metav1.TableRow {{Cells : []interface {}{"test6" , "1/2" , "Running" , int64 (6 ), "<unknown>" }}},
1081
1100
},
1082
1101
}
0 commit comments