@@ -78,7 +78,7 @@ func (f *ObjWithWrongV1beta2ConditionType) DeepCopyObject() runtime.Object {
78
78
}
79
79
80
80
func TestGetAll (t * testing.T ) {
81
- now := metav1 .Now ().Rfc3339Copy ()
81
+ now := metav1.Time { Time : metav1 . Now ().Rfc3339Copy (). UTC ()}
82
82
83
83
t .Run ("fails with nil" , func (t * testing.T ) {
84
84
g := NewWithT (t )
@@ -174,7 +174,7 @@ func TestGetAll(t *testing.T) {
174
174
175
175
got , err = GetAll (& unstructured.Unstructured {Object : fooUnstructured })
176
176
g .Expect (err ).NotTo (HaveOccurred ())
177
- g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
177
+ g .Expect (got ).To (MatchConditions (expect , IgnoreLastTransitionTime ( true ) ), cmp .Diff (got , expect ))
178
178
})
179
179
180
180
t .Run ("v1beta1 object with both legacy and v1beta2 conditions" , func (t * testing.T ) {
@@ -216,14 +216,14 @@ func TestGetAll(t *testing.T) {
216
216
217
217
got , err := GetAll (foo )
218
218
g .Expect (err ).NotTo (HaveOccurred ())
219
- g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
219
+ g .Expect (got ).To (MatchConditions (expect , IgnoreLastTransitionTime ( true ) ), cmp .Diff (got , expect ))
220
220
221
221
fooUnstructured , err := runtime .DefaultUnstructuredConverter .ToUnstructured (foo )
222
222
g .Expect (err ).NotTo (HaveOccurred ())
223
223
224
224
got , err = GetAll (& unstructured.Unstructured {Object : fooUnstructured })
225
225
g .Expect (err ).NotTo (HaveOccurred ())
226
- g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
226
+ g .Expect (got ).To (MatchConditions (expect , IgnoreLastTransitionTime ( true ) ), cmp .Diff (got , expect ))
227
227
})
228
228
229
229
t .Run ("v1beta2 object with conditions and backward compatible conditions" , func (t * testing.T ) {
@@ -263,14 +263,14 @@ func TestGetAll(t *testing.T) {
263
263
264
264
got , err := GetAll (foo )
265
265
g .Expect (err ).NotTo (HaveOccurred ())
266
- g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
266
+ g .Expect (got ).To (MatchConditions (expect , IgnoreLastTransitionTime ( true ) ), cmp .Diff (got , expect ))
267
267
268
268
fooUnstructured , err := runtime .DefaultUnstructuredConverter .ToUnstructured (foo )
269
269
g .Expect (err ).NotTo (HaveOccurred ())
270
270
271
271
got , err = GetAll (& unstructured.Unstructured {Object : fooUnstructured })
272
272
g .Expect (err ).NotTo (HaveOccurred ())
273
- g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
273
+ g .Expect (got ).To (MatchConditions (expect , IgnoreLastTransitionTime ( true ) ), cmp .Diff (got , expect ))
274
274
})
275
275
276
276
t .Run ("v1beta2 object with conditions (end state)" , func (t * testing.T ) {
@@ -299,14 +299,14 @@ func TestGetAll(t *testing.T) {
299
299
300
300
got , err := GetAll (foo )
301
301
g .Expect (err ).NotTo (HaveOccurred ())
302
- g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
302
+ g .Expect (got ).To (MatchConditions (expect , IgnoreLastTransitionTime ( true ) ), cmp .Diff (got , expect ))
303
303
304
304
fooUnstructured , err := runtime .DefaultUnstructuredConverter .ToUnstructured (foo )
305
305
g .Expect (err ).NotTo (HaveOccurred ())
306
306
307
307
got , err = GetAll (& unstructured.Unstructured {Object : fooUnstructured })
308
308
g .Expect (err ).NotTo (HaveOccurred ())
309
- g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
309
+ g .Expect (got ).To (MatchConditions (expect , IgnoreLastTransitionTime ( true ) ), cmp .Diff (got , expect ))
310
310
})
311
311
}
312
312
0 commit comments