@@ -371,26 +371,28 @@ func deployCustomResourceWebhookAndService(f *framework.Framework, image string,
371
371
framework .ExpectNoError (err , "waiting for service %s/%s have %d endpoint" , namespace , serviceCRDName , 1 )
372
372
}
373
373
374
- func verifyV1Object (f * framework. Framework , crd * apiextensionsv1.CustomResourceDefinition , obj * unstructured.Unstructured ) {
374
+ func verifyV1Object (crd * apiextensionsv1.CustomResourceDefinition , obj * unstructured.Unstructured ) {
375
375
gomega .Expect (obj .GetAPIVersion ()).To (gomega .BeEquivalentTo (crd .Spec .Group + "/v1" ))
376
376
hostPort , exists := obj .Object ["hostPort" ]
377
- gomega .Expect (exists ).To (gomega .BeTrue ())
377
+ framework .ExpectEqual (exists , true )
378
+
378
379
gomega .Expect (hostPort ).To (gomega .BeEquivalentTo ("localhost:8080" ))
379
380
_ , hostExists := obj .Object ["host" ]
380
- gomega . Expect (hostExists ). To ( gomega . BeFalse () )
381
+ framework . ExpectEqual (hostExists , false )
381
382
_ , portExists := obj .Object ["port" ]
382
- gomega . Expect (portExists ). To ( gomega . BeFalse () )
383
+ framework . ExpectEqual (portExists , false )
383
384
}
384
385
385
- func verifyV2Object (f * framework. Framework , crd * apiextensionsv1.CustomResourceDefinition , obj * unstructured.Unstructured ) {
386
+ func verifyV2Object (crd * apiextensionsv1.CustomResourceDefinition , obj * unstructured.Unstructured ) {
386
387
gomega .Expect (obj .GetAPIVersion ()).To (gomega .BeEquivalentTo (crd .Spec .Group + "/v2" ))
387
388
_ , hostPortExists := obj .Object ["hostPort" ]
388
- gomega .Expect (hostPortExists ).To (gomega .BeFalse ())
389
+ framework .ExpectEqual (hostPortExists , false )
390
+
389
391
host , hostExists := obj .Object ["host" ]
390
- gomega . Expect (hostExists ). To ( gomega . BeTrue () )
392
+ framework . ExpectEqual (hostExists , true )
391
393
gomega .Expect (host ).To (gomega .BeEquivalentTo ("localhost" ))
392
394
port , portExists := obj .Object ["port" ]
393
- gomega . Expect (portExists ). To ( gomega . BeTrue () )
395
+ framework . ExpectEqual (portExists , true )
394
396
gomega .Expect (port ).To (gomega .BeEquivalentTo ("8080" ))
395
397
}
396
398
@@ -413,7 +415,7 @@ func testCustomResourceConversionWebhook(f *framework.Framework, crd *apiextensi
413
415
ginkgo .By ("v2 custom resource should be converted" )
414
416
v2crd , err := customResourceClients ["v2" ].Get (name , metav1.GetOptions {})
415
417
framework .ExpectNoError (err , "Getting v2 of custom resource %s" , name )
416
- verifyV2Object (f , crd , v2crd )
418
+ verifyV2Object (crd , v2crd )
417
419
}
418
420
419
421
func testCRListConversion (f * framework.Framework , testCrd * crd.TestCrd ) {
@@ -473,19 +475,19 @@ func testCRListConversion(f *framework.Framework, testCrd *crd.TestCrd) {
473
475
list , err := customResourceClients ["v1" ].List (metav1.ListOptions {})
474
476
gomega .Expect (err ).To (gomega .BeNil ())
475
477
gomega .Expect (len (list .Items )).To (gomega .BeIdenticalTo (2 ))
476
- gomega . Expect ((list .Items [0 ].GetName () == name1 && list .Items [1 ].GetName () == name2 ) ||
477
- (list .Items [0 ].GetName () == name2 && list .Items [1 ].GetName () == name1 )). To ( gomega . BeTrue () )
478
- verifyV1Object (f , crd , & list .Items [0 ])
479
- verifyV1Object (f , crd , & list .Items [1 ])
478
+ framework . ExpectEqual ((list .Items [0 ].GetName () == name1 && list .Items [1 ].GetName () == name2 ) ||
479
+ (list .Items [0 ].GetName () == name2 && list .Items [1 ].GetName () == name1 ), true )
480
+ verifyV1Object (crd , & list .Items [0 ])
481
+ verifyV1Object (crd , & list .Items [1 ])
480
482
481
483
ginkgo .By ("List CRs in v2" )
482
484
list , err = customResourceClients ["v2" ].List (metav1.ListOptions {})
483
485
gomega .Expect (err ).To (gomega .BeNil ())
484
486
gomega .Expect (len (list .Items )).To (gomega .BeIdenticalTo (2 ))
485
- gomega . Expect ((list .Items [0 ].GetName () == name1 && list .Items [1 ].GetName () == name2 ) ||
486
- (list .Items [0 ].GetName () == name2 && list .Items [1 ].GetName () == name1 )). To ( gomega . BeTrue () )
487
- verifyV2Object (f , crd , & list .Items [0 ])
488
- verifyV2Object (f , crd , & list .Items [1 ])
487
+ framework . ExpectEqual ((list .Items [0 ].GetName () == name1 && list .Items [1 ].GetName () == name2 ) ||
488
+ (list .Items [0 ].GetName () == name2 && list .Items [1 ].GetName () == name1 ), true )
489
+ verifyV2Object (crd , & list .Items [0 ])
490
+ verifyV2Object (crd , & list .Items [1 ])
489
491
}
490
492
491
493
// waitWebhookConversionReady sends stub custom resource creation requests requiring conversion until one succeeds.
0 commit comments