@@ -522,7 +522,13 @@ func setupCRDAndVerifySchema(f *framework.Framework, schema, expect []byte, grou
522
522
return setupCRDAndVerifySchemaWithOptions (f , schema , expect , groupSuffix , versions )
523
523
}
524
524
525
- func setupCRDAndVerifySchemaWithOptions (f * framework.Framework , schema , expect []byte , groupSuffix string , versions []string , options ... crd.Option ) (* crd.TestCrd , error ) {
525
+ func setupCRDAndVerifySchemaWithOptions (f * framework.Framework , schema , expect []byte , groupSuffix string , versions []string , options ... crd.Option ) (tCRD * crd.TestCrd , err error ) {
526
+ defer func () {
527
+ if err != nil {
528
+ framework .Logf ("sleeping 45 seconds before running the actual tests, we hope that during all API servers converge during that window, see %q for more" , "https://github.com/kubernetes/kubernetes/pull/90452" )
529
+ time .Sleep (time .Second * 45 )
530
+ }
531
+ }()
526
532
group := fmt .Sprintf ("%s-test-%s.example.com" , f .BaseName , groupSuffix )
527
533
if len (versions ) == 0 {
528
534
return nil , fmt .Errorf ("require at least one version for CRD" )
@@ -560,17 +566,17 @@ func setupCRDAndVerifySchemaWithOptions(f *framework.Framework, schema, expect [
560
566
}
561
567
crd .Spec .Versions = apiVersions
562
568
})
563
- crd , err : = crd .CreateMultiVersionTestCRD (f , group , options ... )
569
+ tCRD , err = crd .CreateMultiVersionTestCRD (f , group , options ... )
564
570
if err != nil {
565
571
return nil , fmt .Errorf ("failed to create CRD: %w" , err )
566
572
}
567
573
568
- for _ , v := range crd .Crd .Spec .Versions {
569
- if err := waitForDefinition (f .ClientSet , definitionName (crd , v .Name ), expect ); err != nil {
574
+ for _ , v := range tCRD .Crd .Spec .Versions {
575
+ if err := waitForDefinition (f .ClientSet , definitionName (tCRD , v .Name ), expect ); err != nil {
570
576
return nil , fmt .Errorf ("%v" , err )
571
577
}
572
578
}
573
- return crd , nil
579
+ return tCRD , nil
574
580
}
575
581
576
582
func cleanupCRD (ctx context.Context , f * framework.Framework , crd * crd.TestCrd ) error {
0 commit comments