mirror of
https://github.com/containers/podman.git
synced 2025-07-03 01:08:02 +08:00
Merge pull request #18640 from HirazawaUi/add-pasta-to-podman-info
podman: Add pasta to podman info
This commit is contained in:
@ -87,6 +87,15 @@ host:
|
||||
spec: 1.0.0
|
||||
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
|
||||
os: linux
|
||||
pasta:
|
||||
executable: /usr/bin/passt
|
||||
package: passt-0^20221116.gace074c-1.fc34.x86_64
|
||||
version: |
|
||||
passt 0^20221116.gace074c-1.fc34.x86_64
|
||||
Copyright Red Hat
|
||||
GNU Affero GPL version 3 or later <https://www.gnu.org/licenses/agpl-3.0.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
remoteSocket:
|
||||
path: /run/user/3267/podman/podman.sock
|
||||
security:
|
||||
@ -235,6 +244,11 @@ $ podman info --format json
|
||||
"package": "slirp4netns-1.1.12-2.fc34.x86_64",
|
||||
"version": "slirp4netns version 1.1.12\ncommit: 7a104a101aa3278a2152351a082a6df71f57c9a3\nlibslirp: 4.4.0\nSLIRP_CONFIG_VERSION_MAX: 3\nlibseccomp: 2.5.0"
|
||||
},
|
||||
"pasta": {
|
||||
"executable": "/usr/bin/passt",
|
||||
"package": "passt-0^20221116.gace074c-1.fc34.x86_64",
|
||||
"version": "passt 0^20221116.gace074c-1.fc34.x86_64\nCopyright Red Hat\nGNU Affero GPL version 3 or later \u003chttps://www.gnu.org/licenses/agpl-3.0.html\u003e\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n"
|
||||
},
|
||||
"swapFree": 15687475200,
|
||||
"swapTotal": 16886259712,
|
||||
"uptime": "47h 17m 29.75s (Approximately 1.96 days)",
|
||||
|
@ -54,10 +54,12 @@ type HostInfo struct {
|
||||
ServiceIsRemote bool `json:"serviceIsRemote"`
|
||||
Security SecurityInfo `json:"security"`
|
||||
Slirp4NetNS SlirpInfo `json:"slirp4netns,omitempty"`
|
||||
SwapFree int64 `json:"swapFree"`
|
||||
SwapTotal int64 `json:"swapTotal"`
|
||||
Uptime string `json:"uptime"`
|
||||
Linkmode string `json:"linkmode"`
|
||||
Pasta PastaInfo `json:"pasta,omitempty"`
|
||||
|
||||
SwapFree int64 `json:"swapFree"`
|
||||
SwapTotal int64 `json:"swapTotal"`
|
||||
Uptime string `json:"uptime"`
|
||||
Linkmode string `json:"linkmode"`
|
||||
}
|
||||
|
||||
// RemoteSocket describes information about the API socket
|
||||
@ -73,6 +75,13 @@ type SlirpInfo struct {
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
// PastaInfo describes the pasta executable that is being used
|
||||
type PastaInfo struct {
|
||||
Executable string `json:"executable"`
|
||||
Package string `json:"package"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
// IDMappings describe the GID and UID mappings
|
||||
type IDMappings struct {
|
||||
GIDMap []idtools.IDMap `json:"gidmap"`
|
||||
|
@ -71,6 +71,20 @@ func (r *Runtime) setPlatformHostInfo(info *define.HostInfo) error {
|
||||
info.Slirp4NetNS = program
|
||||
}
|
||||
|
||||
pastaPath, _ := r.config.FindHelperBinary(pastaBinaryName, true)
|
||||
if pastaPath != "" {
|
||||
version, err := programVersion(pastaPath)
|
||||
if err != nil {
|
||||
logrus.Warnf("Failed to retrieve program version for %s: %v", pastaPath, err)
|
||||
}
|
||||
program := define.PastaInfo{
|
||||
Executable: pastaPath,
|
||||
Package: packageVersion(pastaPath),
|
||||
Version: version,
|
||||
}
|
||||
info.Pasta = program
|
||||
}
|
||||
|
||||
if rootless.IsRootless() {
|
||||
uidmappings, err := rootless.ReadMappingsProc("/proc/self/uid_map")
|
||||
if err != nil {
|
||||
|
@ -15,6 +15,10 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const (
|
||||
pastaBinaryName = "passt"
|
||||
)
|
||||
|
||||
func (r *Runtime) setupPasta(ctr *Container, netns string) error {
|
||||
var NoTCPInitPorts = true
|
||||
var NoUDPInitPorts = true
|
||||
|
@ -43,6 +43,7 @@ host.conmon.package | .*conmon.*
|
||||
host.cgroupManager | \\\(systemd\\\|cgroupfs\\\)
|
||||
host.cgroupVersion | v[12]
|
||||
host.ociRuntime.path | $expr_path
|
||||
host.pasta | .*executable.*package.*
|
||||
store.configFile | $expr_path
|
||||
store.graphDriverName | [a-z0-9]\\\+\\\$
|
||||
store.graphRoot | $expr_path
|
||||
|
Reference in New Issue
Block a user