File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -390,13 +390,19 @@ func (t *BuildResult) dumpRegistryLogs() {
390390 }
391391
392392 since := time .Now ().Sub (* buildStarted )
393+
394+ // Changing the namespace on the derived client still changes it on the original client
395+ // because the kubeFramework field is only copied by reference. Saving the original namespace
396+ // here so we can restore it when done with registry logs
397+ savedNamespace := t .oc .Namespace ()
393398 oadm := t .oc .AsAdmin ().SetNamespace ("default" )
394399 out , err := oadm .Run ("logs" ).Args ("dc/docker-registry" , "--since=" + since .String ()).Output ()
395400 if err != nil {
396401 fmt .Fprintf (g .GinkgoWriter , "Error during log retrieval: %+v\n " , err )
397402 } else {
398403 fmt .Fprintf (g .GinkgoWriter , "%s\n " , out )
399404 }
405+ t .oc .SetNamespace (savedNamespace )
400406
401407 fmt .Fprintf (g .GinkgoWriter , "\n \n " )
402408}
You can’t perform that action at this time.
0 commit comments