@@ -523,7 +523,13 @@ func setupCRDAndVerifySchema(f *framework.Framework, schema, expect []byte, grou
523
523
return setupCRDAndVerifySchemaWithOptions (f , schema , expect , groupSuffix , versions )
524
524
}
525
525
526
- func setupCRDAndVerifySchemaWithOptions (f * framework.Framework , schema , expect []byte , groupSuffix string , versions []string , options ... crd.Option ) (* crd.TestCrd , error ) {
526
+ func setupCRDAndVerifySchemaWithOptions (f * framework.Framework , schema , expect []byte , groupSuffix string , versions []string , options ... crd.Option ) (tCRD * crd.TestCrd , err error ) {
527
+ defer func () {
528
+ if err != nil {
529
+ 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" )
530
+ time .Sleep (time .Second * 45 )
531
+ }
532
+ }()
527
533
group := fmt .Sprintf ("%s-test-%s.example.com" , f .BaseName , groupSuffix )
528
534
if len (versions ) == 0 {
529
535
return nil , fmt .Errorf ("require at least one version for CRD" )
@@ -561,17 +567,17 @@ func setupCRDAndVerifySchemaWithOptions(f *framework.Framework, schema, expect [
561
567
}
562
568
crd .Spec .Versions = apiVersions
563
569
})
564
- crd , err : = crd .CreateMultiVersionTestCRD (f , group , options ... )
570
+ tCRD , err = crd .CreateMultiVersionTestCRD (f , group , options ... )
565
571
if err != nil {
566
572
return nil , fmt .Errorf ("failed to create CRD: %w" , err )
567
573
}
568
574
569
- for _ , v := range crd .Crd .Spec .Versions {
570
- if err := waitForDefinition (f .ClientSet , definitionName (crd , v .Name ), expect ); err != nil {
575
+ for _ , v := range tCRD .Crd .Spec .Versions {
576
+ if err := waitForDefinition (f .ClientSet , definitionName (tCRD , v .Name ), expect ); err != nil {
571
577
return nil , fmt .Errorf ("%v" , err )
572
578
}
573
579
}
574
- return crd , nil
580
+ return tCRD , nil
575
581
}
576
582
577
583
func cleanupCRD (ctx context.Context , f * framework.Framework , crd * crd.TestCrd ) error {
0 commit comments