@@ -578,14 +578,24 @@ func StartPodLogs(f *framework.Framework, driverNamespace *v1.Namespace) func()
578
578
to .LogWriter = ginkgo .GinkgoWriter
579
579
} else {
580
580
test := ginkgo .CurrentGinkgoTestDescription ()
581
+ // Clean up each individual component text such that
582
+ // it contains only characters that are valid as file
583
+ // name.
581
584
reg := regexp .MustCompile ("[^a-zA-Z0-9_-]+" )
585
+ var components []string
586
+ for _ , component := range test .ComponentTexts {
587
+ components = append (components , reg .ReplaceAllString (component , "_" ))
588
+ }
582
589
// We end the prefix with a slash to ensure that all logs
583
590
// end up in a directory named after the current test.
584
591
//
585
- // TODO: use a deeper directory hierarchy once gubernator
586
- // supports that (https://github.com/kubernetes/test-infra/issues/10289).
592
+ // Each component name maps to a directory. This
593
+ // avoids cluttering the root artifact directory and
594
+ // keeps each directory name smaller (the full test
595
+ // name at one point exceeded 256 characters, which was
596
+ // too much for some filesystems).
587
597
to .LogPathPrefix = framework .TestContext .ReportDir + "/" +
588
- reg . ReplaceAllString ( test . FullTestText , "_ " ) + "/"
598
+ strings . Join ( components , "/ " ) + "/"
589
599
}
590
600
podlogs .CopyAllLogs (ctx , cs , ns , to )
591
601
0 commit comments