feat/bug-report-extended (#1163)
* fix: connect to docker **after** checking configs * feat: add vcs build info Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
89947735d5
commit
dfdafd9e85
1 changed files with 23 additions and 6 deletions
29
cmd/root.go
29
cmd/root.go
|
@ -8,6 +8,7 @@ import (
|
|||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
|
@ -154,12 +155,6 @@ func bugReport(ctx context.Context, version string) error {
|
|||
}
|
||||
}
|
||||
|
||||
info, err := container.GetHostInfo(ctx)
|
||||
if err != nil {
|
||||
fmt.Println(report)
|
||||
return err
|
||||
}
|
||||
|
||||
report += sprintf("Config files:", "")
|
||||
for _, c := range configLocations() {
|
||||
args := readArgsFile(c, false)
|
||||
|
@ -171,6 +166,28 @@ func bugReport(ctx context.Context, version string) error {
|
|||
}
|
||||
}
|
||||
|
||||
vcs, ok := debug.ReadBuildInfo()
|
||||
if ok && vcs != nil {
|
||||
report += fmt.Sprintln("Build info:")
|
||||
vcs := *vcs
|
||||
report += sprintf("\tGo version:", vcs.GoVersion)
|
||||
report += sprintf("\tModule path:", vcs.Path)
|
||||
report += sprintf("\tMain version:", vcs.Main.Version)
|
||||
report += sprintf("\tMain path:", vcs.Main.Path)
|
||||
report += sprintf("\tMain checksum:", vcs.Main.Sum)
|
||||
|
||||
report += fmt.Sprintln("\tBuild settings:")
|
||||
for _, set := range vcs.Settings {
|
||||
report += sprintf(fmt.Sprintf("\t\t%s:", set.Key), set.Value)
|
||||
}
|
||||
}
|
||||
|
||||
info, err := container.GetHostInfo(ctx)
|
||||
if err != nil {
|
||||
fmt.Println(report)
|
||||
return err
|
||||
}
|
||||
|
||||
report += fmt.Sprintln("Docker Engine:")
|
||||
|
||||
report += sprintf("\tEngine version:", info.ServerVersion)
|
||||
|
|
Loading…
Reference in a new issue