mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
runc: add libpathrs info to --version and features
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This commit is contained in:
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- The poststart hooks are now executed after starting the user-specified
|
- The poststart hooks are now executed after starting the user-specified
|
||||||
process, fixing a runtime-spec conformance issue. (#4347, #5186)
|
process, fixing a runtime-spec conformance issue. (#4347, #5186)
|
||||||
|
|
||||||
|
### Added ###
|
||||||
|
- `runc version` and `runc features` now provide version information about
|
||||||
|
libpathrs when runc is built with the `libpathrs` build tag. (#5291)
|
||||||
|
|
||||||
### Changed ###
|
### Changed ###
|
||||||
- runc now depends on [libpathrs v0.2.5] or later, and attempting to build with
|
- runc now depends on [libpathrs v0.2.5] or later, and attempting to build with
|
||||||
older versions will cause compilation errors. (#5291)
|
older versions will cause compilation errors. (#5291)
|
||||||
|
|||||||
@@ -96,6 +96,10 @@ var featuresCommand = &cli.Command{
|
|||||||
feat.Annotations[runcfeatures.AnnotationLibseccompVersion] = fmt.Sprintf("%d.%d.%d", major, minor, patch)
|
feat.Annotations[runcfeatures.AnnotationLibseccompVersion] = fmt.Sprintf("%d.%d.%d", major, minor, patch)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v := pathrsVersionString(); v != "" {
|
||||||
|
feat.Annotations[runcfeatures.AnnotationLibpathrsVersion] = v
|
||||||
|
}
|
||||||
|
|
||||||
enc := json.NewEncoder(cmd.Writer)
|
enc := json.NewEncoder(cmd.Writer)
|
||||||
enc.SetIndent("", " ")
|
enc.SetIndent("", " ")
|
||||||
return enc.Encode(feat)
|
return enc.Encode(feat)
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
//go:build libpathrs
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"cyphar.com/go-pathrs"
|
||||||
|
)
|
||||||
|
|
||||||
|
func pathrsVersionString() string {
|
||||||
|
info, err := pathrs.LibraryVersion()
|
||||||
|
if err != nil {
|
||||||
|
panic(err) // should never happen
|
||||||
|
}
|
||||||
|
return info.VersionString
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
//go:build !libpathrs
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
func pathrsVersionString() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ module github.com/opencontainers/runc
|
|||||||
go 1.25.0
|
go 1.25.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
cyphar.com/go-pathrs v0.2.5
|
||||||
github.com/checkpoint-restore/go-criu/v8 v8.3.0
|
github.com/checkpoint-restore/go-criu/v8 v8.3.0
|
||||||
github.com/containerd/console v1.0.5
|
github.com/containerd/console v1.0.5
|
||||||
github.com/coreos/go-systemd/v22 v22.7.0
|
github.com/coreos/go-systemd/v22 v22.7.0
|
||||||
@@ -28,7 +29,6 @@ require (
|
|||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cyphar.com/go-pathrs v0.2.5 // indirect
|
|
||||||
github.com/aperturerobotics/protobuf-go-lite v0.14.0 // indirect
|
github.com/aperturerobotics/protobuf-go-lite v0.14.0 // indirect
|
||||||
github.com/cilium/ebpf v0.17.3 // indirect
|
github.com/cilium/ebpf v0.17.3 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ func printVersion(c *cli.Command) {
|
|||||||
if major+minor+micro > 0 {
|
if major+minor+micro > 0 {
|
||||||
fmt.Fprintf(w, "libseccomp: %d.%d.%d\n", major, minor, micro)
|
fmt.Fprintf(w, "libseccomp: %d.%d.%d\n", major, minor, micro)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v := pathrsVersionString(); v != "" {
|
||||||
|
fmt.Fprintf(w, "libpathrs: %s\n", v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -22,4 +22,7 @@ const (
|
|||||||
// AnnotationLibseccompVersion is the version of libseccomp, e.g., "2.5.1".
|
// AnnotationLibseccompVersion is the version of libseccomp, e.g., "2.5.1".
|
||||||
// Note that the runtime MAY support seccomp even when this annotation is not present.
|
// Note that the runtime MAY support seccomp even when this annotation is not present.
|
||||||
AnnotationLibseccompVersion = "io.github.seccomp.libseccomp.version"
|
AnnotationLibseccompVersion = "io.github.seccomp.libseccomp.version"
|
||||||
|
|
||||||
|
// AnnotationLibpathrsVersion is the runtime version of libpathrs.
|
||||||
|
AnnotationLibpathrsVersion = "com.cyphar.pathrs.libpathrs.version"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user