add libseccomp version to `runc --version`
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
1d85333ad8
commit
6249136a29
|
@ -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
|
||||
}
|
||||
|
|
6
main.go
6
main.go
|
@ -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 := ""
|
||||
|
|
Loading…
Reference in New Issue