Skip to content

Commit 18962de

Browse files
author
OpenShift Bot
authored
Merge pull request #13578 from csrwng/fix_build_ext_tests
Merged by openshift-bot
2 parents 2130ec6 + d88ca2f commit 18962de

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/extended/util/framework.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)