add runtime.Version() to runc --version

Printing Go version would be helpful to debug runtime-related errors.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2020-08-04 14:59:25 +09:00
parent a340fa9b56
commit 1d85333ad8
+2
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"io"
"os"
"runtime"
"strings"
"github.com/opencontainers/runc/libcontainer/logs"
@@ -62,6 +63,7 @@ func main() {
v = append(v, fmt.Sprintf("commit: %s", gitCommit))
}
v = append(v, fmt.Sprintf("spec: %s", specs.Version))
v = append(v, fmt.Sprintf("go: %s", runtime.Version()))
app.Version = strings.Join(v, "\n")
xdgRuntimeDir := ""