From 1fa702886b5e0bf53a3f6fcbc1debe49464376f2 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Tue, 7 Jun 2016 15:48:59 +0100 Subject: [PATCH] diagnostics: dump the master branch of the database Signed-off-by: Rolf Neugebauer --- alpine/packages/diagnostics/main.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/alpine/packages/diagnostics/main.go b/alpine/packages/diagnostics/main.go index b6fd0e501..28ca11775 100644 --- a/alpine/packages/diagnostics/main.go +++ b/alpine/packages/diagnostics/main.go @@ -6,8 +6,10 @@ import ( "io" "log" "net" + "os" "os/exec" "path" + "path/filepath" "strings" "time" @@ -103,6 +105,15 @@ func capture(w *tar.Writer) { run(t, w, "/bin/cp", "/etc/resolv.conf", ".") run(t, w, "/usr/bin/dig", "docker.com") run(t, w, "/usr/bin/wget", "-O", "-", "http://www.docker.com/") + + // Dump the database + dbBase := "/Database/branch/master/ro" + filepath.Walk(dbBase, func(path string, f os.FileInfo, err error) error { + if f.Mode().IsRegular() { + run(t, w, "/bin/cat", path) + } + return nil + }) } func main() {