mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
add libseccomp version to runc --version
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
@@ -266,3 +266,8 @@ func parseStatusFile(path string) (map[string]string, error) {
|
||||
|
||||
return status, nil
|
||||
}
|
||||
|
||||
// Version returns major, minor, and micro.
|
||||
func Version() (uint, uint, uint) {
|
||||
return libseccomp.GetLibraryVersion()
|
||||
}
|
||||
|
||||
@@ -22,3 +22,8 @@ func InitSeccomp(config *configs.Seccomp) error {
|
||||
func IsEnabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Version returns major, minor, and micro.
|
||||
func Version() (uint, uint, uint) {
|
||||
return 0, 0, 0
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/logs"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/seccomp"
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -64,6 +64,10 @@ func main() {
|
||||
}
|
||||
v = append(v, fmt.Sprintf("spec: %s", specs.Version))
|
||||
v = append(v, fmt.Sprintf("go: %s", runtime.Version()))
|
||||
if seccomp.IsEnabled() {
|
||||
major, minor, micro := seccomp.Version()
|
||||
v = append(v, fmt.Sprintf("libseccomp: %d.%d.%d", major, minor, micro))
|
||||
}
|
||||
app.Version = strings.Join(v, "\n")
|
||||
|
||||
xdgRuntimeDir := ""
|
||||
|
||||
Reference in New Issue
Block a user