@@ -70,6 +70,11 @@ func TestLogsForObject(t *testing.T) {
70
70
{Name : "c1" },
71
71
{Name : "c2" },
72
72
},
73
+ EphemeralContainers : []corev1.EphemeralContainer {
74
+ {
75
+ EphemeralContainerCommon : corev1.EphemeralContainerCommon {Name : "e1" },
76
+ },
77
+ },
73
78
},
74
79
},
75
80
opts : & corev1.PodLogOptions {},
@@ -80,6 +85,7 @@ func TestLogsForObject(t *testing.T) {
80
85
getLogsAction ("test" , & corev1.PodLogOptions {Container : "initc2" }),
81
86
getLogsAction ("test" , & corev1.PodLogOptions {Container : "c1" }),
82
87
getLogsAction ("test" , & corev1.PodLogOptions {Container : "c2" }),
88
+ getLogsAction ("test" , & corev1.PodLogOptions {Container : "e1" }),
83
89
},
84
90
},
85
91
{
@@ -215,18 +221,22 @@ func TestLogsForObject(t *testing.T) {
215
221
continue
216
222
}
217
223
218
- for i := range test .actions {
224
+ var i int
225
+ for i = range test .actions {
219
226
if len (fakeClientset .Actions ()) < i {
220
- t .Errorf ("%s: action %d does not exists in actual actions: %#v" ,
227
+ t .Errorf ("%s: expected action %d does not exists in actual actions: %#v" ,
221
228
test .name , i , fakeClientset .Actions ())
222
229
continue
223
230
}
224
231
got := fakeClientset .Actions ()[i ]
225
232
want := test .actions [i ]
226
233
if ! reflect .DeepEqual (got , want ) {
227
- t .Errorf ("%s: unexpected action: %s" , test .name , diff .ObjectDiff (got , want ))
234
+ t .Errorf ("%s: unexpected diff for action: %s" , test .name , diff .ObjectDiff (got , want ))
228
235
}
229
236
}
237
+ for i ++ ; i < len (fakeClientset .Actions ()); i ++ {
238
+ t .Errorf ("%s: actual action %d does not exist in expected: %v" , test .name , i , fakeClientset .Actions ()[i ])
239
+ }
230
240
}
231
241
}
232
242
0 commit comments