@@ -357,10 +357,46 @@ func (t *BuildResult) DumpLogs() {
357
357
358
358
fmt .Fprintf (g .GinkgoWriter , "\n \n " )
359
359
360
+ t .dumpRegistryLogs ()
361
+
360
362
// if we suspect that we are filling up the registry file system, call ExamineDiskUsage / ExaminePodDiskUsage
361
363
// also see if manipulations of the quota around /mnt/openshift-xfs-vol-dir exist in the extended test set up scripts
362
- //ExamineDiskUsage()
363
- //ExaminePodDiskUsage(t.oc)
364
+ /*
365
+ ExamineDiskUsage()
366
+ ExaminePodDiskUsage(t.oc)
367
+ fmt.Fprintf(g.GinkgoWriter, "\n\n")
368
+ */
369
+ }
370
+
371
+ func (t * BuildResult ) dumpRegistryLogs () {
372
+ var buildStarted * time.Time
373
+ oc := t .oc
374
+ fmt .Fprintf (g .GinkgoWriter , "\n ** Registry Logs:\n " )
375
+
376
+ if t .Build != nil && ! t .Build .CreationTimestamp .IsZero () {
377
+ buildStarted = & t .Build .CreationTimestamp .Time
378
+ } else {
379
+ proj , err := oc .Client ().Projects ().Get (oc .Namespace ())
380
+ if err != nil {
381
+ fmt .Fprintf (g .GinkgoWriter , "Failed to get project %s: %v\n " , oc .Namespace (), err )
382
+ } else {
383
+ buildStarted = & proj .CreationTimestamp .Time
384
+ }
385
+ }
386
+
387
+ if buildStarted == nil {
388
+ fmt .Fprintf (g .GinkgoWriter , "Could not determine test' start time\n \n \n " )
389
+ return
390
+ }
391
+
392
+ since := time .Now ().Sub (* buildStarted )
393
+ oadm := t .oc .AsAdmin ().SetNamespace ("default" )
394
+ out , err := oadm .Run ("logs" ).Args ("dc/docker-registry" , "--since=" + since .String ()).Output ()
395
+ if err != nil {
396
+ fmt .Fprintf (g .GinkgoWriter , "Error during log retrieval: %+v\n " , err )
397
+ } else {
398
+ fmt .Fprintf (g .GinkgoWriter , "%s\n " , out )
399
+ }
364
400
365
401
fmt .Fprintf (g .GinkgoWriter , "\n \n " )
366
402
}
0 commit comments