@@ -152,7 +152,7 @@ func TestGetAll(t *testing.T) {
152
152
Status : builder.Phase0ObjStatus {
153
153
Conditions : clusterv1.Conditions {
154
154
{
155
- Type : "fooCondition " ,
155
+ Type : "barCondition " ,
156
156
Status : corev1 .ConditionTrue ,
157
157
LastTransitionTime : now ,
158
158
},
@@ -184,14 +184,14 @@ func TestGetAll(t *testing.T) {
184
184
185
185
got , err := GetAll (foo )
186
186
g .Expect (err ).NotTo (HaveOccurred ())
187
- g .Expect (got ).To (Equal (expect ), cmp .Diff (got , expect ))
187
+ g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
188
188
189
189
fooUnstructured , err := runtime .DefaultUnstructuredConverter .ToUnstructured (foo )
190
190
g .Expect (err ).NotTo (HaveOccurred ())
191
191
192
192
got , err = GetAll (& unstructured.Unstructured {Object : fooUnstructured })
193
193
g .Expect (err ).NotTo (HaveOccurred ())
194
- g .Expect (got ).To (Equal (expect ), cmp .Diff (got , expect ))
194
+ g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
195
195
})
196
196
197
197
t .Run ("v1beta1 object with both legacy and experimental conditions" , func (t * testing.T ) {
@@ -231,14 +231,14 @@ func TestGetAll(t *testing.T) {
231
231
232
232
got , err := GetAll (foo )
233
233
g .Expect (err ).NotTo (HaveOccurred ())
234
- g .Expect (got ).To (Equal (expect ), cmp .Diff (got , expect ))
234
+ g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
235
235
236
236
fooUnstructured , err := runtime .DefaultUnstructuredConverter .ToUnstructured (foo )
237
237
g .Expect (err ).NotTo (HaveOccurred ())
238
238
239
239
got , err = GetAll (& unstructured.Unstructured {Object : fooUnstructured })
240
240
g .Expect (err ).NotTo (HaveOccurred ())
241
- g .Expect (got ).To (Equal (expect ), cmp .Diff (got , expect ))
241
+ g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
242
242
})
243
243
244
244
t .Run ("v1beta2 object with conditions and backward compatible conditions" , func (t * testing.T ) {
@@ -274,14 +274,14 @@ func TestGetAll(t *testing.T) {
274
274
275
275
got , err := GetAll (foo )
276
276
g .Expect (err ).NotTo (HaveOccurred ())
277
- g .Expect (got ).To (Equal (expect ), cmp .Diff (got , expect ))
277
+ g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
278
278
279
279
fooUnstructured , err := runtime .DefaultUnstructuredConverter .ToUnstructured (foo )
280
280
g .Expect (err ).NotTo (HaveOccurred ())
281
281
282
282
got , err = GetAll (& unstructured.Unstructured {Object : fooUnstructured })
283
283
g .Expect (err ).NotTo (HaveOccurred ())
284
- g .Expect (got ).To (Equal (expect ), cmp .Diff (got , expect ))
284
+ g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
285
285
})
286
286
287
287
t .Run ("v1beta2 object with conditions (end state)" , func (t * testing.T ) {
@@ -308,13 +308,13 @@ func TestGetAll(t *testing.T) {
308
308
309
309
got , err := GetAll (foo )
310
310
g .Expect (err ).NotTo (HaveOccurred ())
311
- g .Expect (got ).To (Equal (expect ), cmp .Diff (got , expect ))
311
+ g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
312
312
313
313
fooUnstructured , err := runtime .DefaultUnstructuredConverter .ToUnstructured (foo )
314
314
g .Expect (err ).NotTo (HaveOccurred ())
315
315
316
316
got , err = GetAll (& unstructured.Unstructured {Object : fooUnstructured })
317
317
g .Expect (err ).NotTo (HaveOccurred ())
318
- g .Expect (got ).To (Equal (expect ), cmp .Diff (got , expect ))
318
+ g .Expect (got ).To (MatchConditions (expect ), cmp .Diff (got , expect ))
319
319
})
320
320
}
0 commit comments