@@ -40,9 +40,10 @@ func TestToPodPodStatusFailed(t *testing.T) {
40
40
}
41
41
42
42
expected := Pod {
43
- TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
44
- Status : string (v1 .PodFailed ),
45
- Warnings : []common.Event {},
43
+ TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
44
+ Status : string (v1 .PodFailed ),
45
+ Warnings : []common.Event {},
46
+ ContainerStatuses : make ([]ContainerStatus , 0 ),
46
47
}
47
48
48
49
actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -67,9 +68,10 @@ func TestToPodPodStatusSucceeded(t *testing.T) {
67
68
}
68
69
69
70
expected := Pod {
70
- TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
71
- Status : string (v1 .PodSucceeded ),
72
- Warnings : []common.Event {},
71
+ TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
72
+ Status : string (v1 .PodSucceeded ),
73
+ Warnings : []common.Event {},
74
+ ContainerStatuses : make ([]ContainerStatus , 0 ),
73
75
}
74
76
75
77
actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -98,9 +100,10 @@ func TestToPodPodStatusRunning(t *testing.T) {
98
100
}
99
101
100
102
expected := Pod {
101
- TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
102
- Status : string (v1 .PodRunning ),
103
- Warnings : []common.Event {},
103
+ TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
104
+ Status : string (v1 .PodRunning ),
105
+ Warnings : []common.Event {},
106
+ ContainerStatuses : make ([]ContainerStatus , 0 ),
104
107
}
105
108
106
109
actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -125,9 +128,10 @@ func TestToPodPodStatusPending(t *testing.T) {
125
128
}
126
129
127
130
expected := Pod {
128
- TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
129
- Status : string (v1 .PodPending ),
130
- Warnings : []common.Event {},
131
+ TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
132
+ Status : string (v1 .PodPending ),
133
+ Warnings : []common.Event {},
134
+ ContainerStatuses : make ([]ContainerStatus , 0 ),
131
135
}
132
136
133
137
actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -165,6 +169,14 @@ func TestToPodContainerStates(t *testing.T) {
165
169
TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
166
170
Status : "Terminated" ,
167
171
Warnings : []common.Event {},
172
+ ContainerStatuses : []ContainerStatus {
173
+ {
174
+ State : Terminated ,
175
+ },
176
+ {
177
+ State : Waiting ,
178
+ },
179
+ },
168
180
}
169
181
170
182
actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -184,8 +196,9 @@ func TestToPod(t *testing.T) {
184
196
{
185
197
pod : & v1.Pod {}, metrics : & MetricsByPod {},
186
198
expected : Pod {
187
- TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
188
- Warnings : []common.Event {},
199
+ TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
200
+ Warnings : []common.Event {},
201
+ ContainerStatuses : make ([]ContainerStatus , 0 ),
189
202
},
190
203
}, {
191
204
pod : & v1.Pod {
@@ -199,7 +212,8 @@ func TestToPod(t *testing.T) {
199
212
Name : "test-pod" ,
200
213
Namespace : "test-namespace" ,
201
214
},
202
- Warnings : []common.Event {},
215
+ Warnings : []common.Event {},
216
+ ContainerStatuses : make ([]ContainerStatus , 0 ),
203
217
},
204
218
},
205
219
}
0 commit comments